Add test for fatfs.
[bertos.git] / bertos / fs / fatfs / doc / en / filename.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
2 <html lang="en">\r
3 <head>\r
4 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">\r
5 <meta http-equiv="Content-Style-Type" content="text/css">\r
6 <link rel="up" title="FatFs" href="../00index_e.html">\r
7 <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r
8 <title>FatFs - File and Path name on the FatFs module</title>\r
9 </head>\r
10 \r
11 <body>\r
12 \r
13 <div class="para">\r
14 <h2>File and Path name on the FatFs module</h2>\r
15 <p>The format of file and path name on the FatFs module is similer to MS-DOS. However it does not have a concept of current directory like OS oriented file system. All objects on the drive are always specified in full path name from the root directory.</p>\r
16 <pre>\r
17 \r
18  "[<em>drive#</em>:][/]<em>directory</em>/<em>file</em>"\r
19 \r
20  "file1.txt"           A file on the drive 0\r
21  "/file1.txt"          (same as above)\r
22  "dir1/dir2/file1.txt" A file on the drive 0\r
23  "2:dir3/file2.txt"    A file on the drive 2\r
24  "2:/dir5"             A directory on the drive 2\r
25  ""                    The root directory on the drive 0\r
26  "/"                   (same as above)\r
27  "2:"                  The root directory on the drive 2\r
28 \r
29 </pre>\r
30 <p>The FatFs module supports long file name and 8.3 format file name. The long file name can be handled when _USE_LFN option is selected. The sub directories are separated with a / or \. Heading separator is ignored and it may be exist or omitted.</p>\r
31 <p>The logical drive number is specified in a numeral with a colon. When the drive number is omitted, it is assumed as default drive (0:).</p>\r
32 </div>\r
33 \r
34 <p><br></p>\r
35 <div class="para">\r
36 <h2>Correspondence between logical/physical drive</h2>\r
37 <p>In default, the FatFs module has work areas that called <em>file system object</em> for each logical drive. The logical drive is bound to the physical drive that has same drive number, and the first partition is mounted. When <tt>_MULTI_PARTITION</tt> is specified in configuration option, each individual logical drive can be bound to any physical drive/partition. In this case, a drive number resolution table must be defined as follows:</p>\r
38 <pre>\r
39 Example: Logical drive 0-2 are assigned to three pri-partitions on the physical drive 0 (fixed disk)\r
40          Logical drive 3 is assigned to physical drive 1 (removable disk)\r
41 \r
42 const PARTITION Drives[] = {\r
43     {0, 0},     /* Logical drive 0 ==> Physical drive 0, 1st partition */\r
44     {0, 1},     /* Logical drive 1 ==> Physical drive 0, 2nd partition */\r
45     {0, 2},     /* Logical drive 2 ==> Physical drive 0, 3rd partition */\r
46     {1, 0}      /* Logical drive 3 ==> Physical drive 1 */\r
47 };\r
48 </pre>\r
49 <p>There are some consideration when use <tt>_MULTI_PARTITION</tt> configuration.</p>\r
50 <ul>\r
51 <li>Only pri-partition (0-3) can be mounted.</li>\r
52 <li>When the physical drive have no partition table (super floppy format), the partition number is ignored.</li>\r
53 <li>The physical drive that has two or more logical drives must be fixed drive.</li>\r
54 </ul>\r
55 </div>\r
56 \r
57 </body>\r
58 </html>\r