filename.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  5. <meta http-equiv="Content-Style-Type" content="text/css">
  6. <link rel="up" title="FatFs" href="../00index_e.html">
  7. <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
  8. <title>FatFs - File and Path name on the FatFs module</title>
  9. </head>
  10. <body>
  11. <div class="para">
  12. <h2>File and Path name on the FatFs module</h2>
  13. <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 specified in full path name from the root directory.</p>
  14. <pre>
  15. "[<em>drive#</em>:][/]<em>directory</em>/<em>file</em>"
  16. "file1.txt" a file on drive 0
  17. "/file1.txt" (same as above)
  18. "dir1/dir2/file1.txt" a file on drive 0
  19. "2:dir3/file2.txt" a file on drive 2
  20. "2:/dir5" a directory on drive 2
  21. "" the root directory on drive 0
  22. "/" (same as above)
  23. "2:" the root directory on drive 2
  24. </pre>
  25. <p>The FatFs module supports only 8.3 format file name and long file name is currentry not supported. For directory separator, a '/' is used, not a '\'. Heading '/' is ignored and can be omitted.</p>
  26. <p>The logical drive number is specified in a numeral with a colon. When the drive number is omitted, it is assumed default drive (0:). As for the Tiny-FatFs, it has only one logical drive and always works as drive 0. Any drive number cannot be contained in the path name.</p>
  27. </div>
  28. <p><br></p>
  29. <div class="para">
  30. <h2>Correspondence between logical/physical drive</h2>
  31. <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>
  32. <pre>
  33. Example: Logical drive 0-2 are assigned to three pri-partitions on the physical drive 0 (fixed disk)
  34. Logical drive 3 is assigned to physical drive 1 (removable disk)
  35. const PARTITION Drives[] = {
  36. {0, 0}, /* Logical drive 0 ==> Physical drive 0, 1st partition */
  37. {0, 1}, /* Logical drive 1 ==> Physical drive 0, 2nd partition */
  38. {0, 2}, /* Logical drive 2 ==> Physical drive 0, 3rd partition */
  39. {1, 0} /* Logical drive 3 ==> Physical drive 1 */
  40. };
  41. </pre>
  42. <p>There are some consideration when use <tt>_MULTI_PARTITION</tt> configuration.</p>
  43. <ul>
  44. <li>Only pri-partition (0-3) can be mounted.</li>
  45. <li>When the physical drive have no partition table (super floppy format), the partition number is ignored.</li>
  46. <li>The physical drive that has two or more logical drives must be fixed drive.</li>
  47. </li>
  48. </div>
  49. </body>
  50. </html>