fatfs v0.16 July 22, 2025:

- Removed a long-pending limitation that f_getcwd and double-dot .. in the path name did not work on the exFAT volume.
- Fixed f_readdir cannot detect end of directory and it leads the application process into infinite loop. (appeared at R0.15b)
- Fixed dot names with terminating separator or duplicated separator are rejected when LFN is not enabled.
This commit is contained in:
savelij13 2025-09-11 10:53:13 +03:00
parent cc71f9a444
commit bf4615c01f
65 changed files with 1199 additions and 828 deletions

View File

@ -31,6 +31,7 @@ hr {border-width: 1px; margin: 1em;}
div.abst {font-family: sans-serif;} div.abst {font-family: sans-serif;}
div.para {clear: both; font-family: serif;} div.para {clear: both; font-family: serif;}
div.ret a {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; } div.ret a {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; }
ul.plain {margin: 0 0 0 1em;}
.equ {text-indent: 0; margin: 1em 2em 1em;} .equ {text-indent: 0; margin: 1em 2em 1em;}
.indent {margin-left: 2em;} .indent {margin-left: 2em;}
.rset {float: right; margin: 0.3em 0 0.5em 0.5em;} .rset {float: right; margin: 0.3em 0 0.5em 0.5em;}

View File

@ -90,7 +90,7 @@ The FatFs module is a middleware written in ANSI C (C89). There is no platform d
<ul> <ul>
<li>Filesystem type: FAT, FAT32(rev0.0) and exFAT(rev1.0).</li> <li>Filesystem type: FAT, FAT32(rev0.0) and exFAT(rev1.0).</li>
<li>Number of open files: Unlimited. (depends on available memory)</li> <li>Number of open files: Unlimited. (depends on available memory)</li>
<li>Number of volumes: Up to 10.</li> <li>Number of mounted volumes: Up to 10.</li>
<li>Sector size: 512, 1024, 2048 and 4096 bytes.</li> <li>Sector size: 512, 1024, 2048 and 4096 bytes.</li>
<li>Minimum volume size: 128 sectors.</li> <li>Minimum volume size: 128 sectors.</li>
<li>Maximum volume size: 2<sup>32</sup> - 1 sectors in 32-bit LBA, virtually unlimited in 64-bit LBA with exFAT.</li> <li>Maximum volume size: 2<sup>32</sup> - 1 sectors in 32-bit LBA, virtually unlimited in 64-bit LBA with exFAT.</li>
@ -116,11 +116,11 @@ The FatFs module is a middleware written in ANSI C (C89). There is no platform d
</table> </table>
<p>These are the memory usage of FatFs module without lower layer on some target systems in following condition. <em>V</em> denotes number of mounted volumes and <em>F</em> denotes number of open files. Every samples here are optimezed in code size.</p> <p>These are the memory usage of FatFs module without lower layer on some target systems in following condition. <em>V</em> denotes number of mounted volumes and <em>F</em> denotes number of open files. Every samples here are optimezed in code size.</p>
<pre> <pre>
FatFs R0.15b options: FatFs R0.16 options:
FF_FS_READONLY 0 (R/W, read/write) or 1 (R/O, read only) FF_FS_READONLY 0 (R/W, read/write) or 1 (R/O, read only)
FF_FS_MINIMIZE 0 (Def, with all basic functions) or 3 (Min, with fully minimized) FF_FS_MINIMIZE 0 (Def, with all basic functions) or 3 (Min, with fully minimized)
FF_FS_TINY 0 (Default) or 1 (Tiny file object) FF_FS_TINY 0 (Default) or 1 (Tiny file object)
And any other options are left unchanged from original setting. Any other option is left unchanged from original settings.
</pre> </pre>
</div> </div>
@ -202,7 +202,7 @@ And any other options are left unchanged from original setting.
<div class="para doc" id="lba64"> <div class="para doc" id="lba64">
<h3>64-bit LBA</h3> <h3>64-bit LBA</h3>
<p>LBA (Logical Block Addressing) is an addressing method to specify the location of data block, called <em>sector</em>, on the storage media. It is a simple linear address beginning from 0 as the first sector, 1 as the second sector and so on. The host system does not need to consider how the data block is located and managed in the storage device. FatFs supports only LBA for the media access. 32-bit LBA is a common size in the most LBA scheme. It can address up to 2<sup>32</sup> sectors, 2 TB in 512 bytes/sector. When a storage device larger than 2 TB is used, larger sector size or 64-bit LBA will be needed to address the entire sectors of the storage device.</p> <p>LBA (Logical Block Addressing) is an addressing method to specify the location of data block, called <em>sector</em>, on the storage media. It is a simple linear address beginning from 0 as the first sector, 1 as the second sector and so on. The host system does not need to consider how the data block is located and managed in the storage device. FatFs supports only LBA for the media access. 32-bit LBA is a common size in the most LBA scheme. It can address up to 2<sup>32</sup> sectors, 2 TB in 512 bytes/sector. When a storage device larger than 2 TB is used, larger sector size or 64-bit LBA will be needed to address the entire sectors of the storage device.</p>
<p>By default, FatFs works in 32-bit LBA for media access. FatFs can also switch it to 64-bit LBA by a configuration option <tt><a href="config.html#fs_lba64">FF_LBA64</a></tt>. It also enables GPT (GUID Partition Table) for partition management on the storage device. For further information about GPT, refer to <tt><a href="mkfs.html">f_mkfs</a></tt> and <tt><a href="fdisk.html">f_fdisk</a></tt> function.</p> <p>By default, FatFs works in 32-bit LBA for media access. By configuration option <a href="config.html#fs_lba64"><tt>FF_LBA64</tt></a>, it can be switched to 64-bit LBA and also GPT (GUID Partition Table) is enabled for partition management on the storage device. For further information about GPT, refer to <tt><a href="mkfs.html">f_mkfs</a></tt> and <tt><a href="fdisk.html">f_fdisk</a></tt> function.</p>
</div> </div>
<div class="para doc" id="reentrant"> <div class="para doc" id="reentrant">
@ -333,6 +333,6 @@ Figure 5. Minimized critical section<br>
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -48,8 +48,8 @@ FRESULT f_chdir (
<div class="para desc"> <div class="para desc">
<h4>Description</h4> <h4>Description</h4>
<p>The <tt>f_chdir</tt> function changes the current directory of the logical drive. Also the current drive will be changed when in Unix style drive prefix, <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a> == 2</tt>. The current directory of each logical drive is initialized to the root directory on mount.</p> <p>The <tt>f_chdir</tt> function changes the current directory of the logical drive. Also the current drive will be changed when FatFs is configured <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a> == 2</tt> and an full path is specified. The current directory of each logical drive is set root directory on mount.</p>
<p>Note that the current directory is retained in the each file system object and the current drive is retained in a static variable, so that it also affects other tasks that use the file functions.</p> <p>Note that the current directory is retained in the each filesystem object and the current drive is retained in a static variable, so that they also affect other tasks that use the file functions.</p>
</div> </div>
@ -62,16 +62,16 @@ FRESULT f_chdir (
<div class="para use"> <div class="para use">
<h4>Example</h4> <h4>Example</h4>
<pre> <pre>
<span class="c">/* Change current direcoty of the current drive ("dir1" under root directory) */</span> <span class="c">/* Set current direcoty of the current drive ("dir1" in the root directory) */</span>
<em>f_chdir</em>("/dir1"); <em>f_chdir</em>("/dir1");
<span class="c">/* Change current direcoty of current drive (parent directory of drive 2) */</span> <span class="c">/* Set current direcoty of drive 2 (parent directory of current directory) */</span>
<em>f_chdir</em>("2:.."); <em>f_chdir</em>("2:..");
<span class="c">/* Change current direcoty of the drive "sdcard" (at DOS/Windows style volume ID) */</span> <span class="c">/* Set current direcoty of drive "sdcard" (<tt>FF_STR_VOLUME_ID == 1</tt>) */</span>
<em>f_chdir</em>("sdcard:/dir1"); <em>f_chdir</em>("sdcard:/dir1");
<span class="c">/* Change current direcoty of the drive "flash" and set it as current drive (at Unix style volume ID) */</span> <span class="c">/* Set current direcoty of drive "flash" and set this drive current drive (<tt>FF_STR_VOLUME_ID == 2</tt>) */</span>
<em>f_chdir</em>("/flash/dir1"); <em>f_chdir</em>("/flash/dir1");
</pre> </pre>
</div> </div>
@ -82,6 +82,6 @@ FRESULT f_chdir (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -64,6 +64,6 @@ FRESULT f_chdrive (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -83,6 +83,6 @@ FRESULT f_chmod (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -59,6 +59,6 @@ FRESULT f_close (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -58,6 +58,6 @@ FRESULT f_closedir (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -35,7 +35,8 @@
<li><a href="#max_lfn">FF_MAX_LFN</a></li> <li><a href="#max_lfn">FF_MAX_LFN</a></li>
<li><a href="#lfn_unicode">FF_LFN_UNICODE</a></li> <li><a href="#lfn_unicode">FF_LFN_UNICODE</a></li>
<li><a href="#lfn_buf">FF_LFN_BUF, FF_SFN_BUF</a></li> <li><a href="#lfn_buf">FF_LFN_BUF, FF_SFN_BUF</a></li>
<li><a href="#fs_rpath">FF_FS_RPATH</a></li> <li><a href="#fs_rpath">FF_RPATH</a></li>
<li><a href="#fs_depth">FF_PATH_DEPTH</a></li>
</ul> </ul>
</li> </li>
<li>Volume/Drive Configurations <li>Volume/Drive Configurations
@ -56,7 +57,7 @@
<li><a href="#fs_exfat">FF_FS_EXFAT</a></li> <li><a href="#fs_exfat">FF_FS_EXFAT</a></li>
<li><a href="#fs_nortc">FF_FS_NORTC</a></li> <li><a href="#fs_nortc">FF_FS_NORTC</a></li>
<li><a href="#nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</a></li> <li><a href="#nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</a></li>
<li><a href="#fs_ctime">FF_FS_CTIME</a></li> <li><a href="#fs_ctime">FF_FS_CRTIME</a></li>
<li><a href="#fs_nofsinfo">FF_FS_NOFSINFO</a></li> <li><a href="#fs_nofsinfo">FF_FS_NOFSINFO</a></li>
<li><a href="#fs_lock">FF_FS_LOCK</a></li> <li><a href="#fs_lock">FF_FS_LOCK</a></li>
<li><a href="#fs_reentrant">FF_FS_REENTRANT</a></li> <li><a href="#fs_reentrant">FF_FS_REENTRANT</a></li>
@ -170,7 +171,7 @@
</table> </table>
<h4 id="use_lfn">FF_USE_LFN</h4> <h4 id="use_lfn">FF_USE_LFN</h4>
<p>This option switches the support for long file name (LFN). When enable the LFN, Unicode support module <tt>ffunicode.c</tt> need to be added to the project. When use stack for the working buffer, take care on stack overflow. When use heap memory for the working buffer, memory management functions (<tt>ff_memalloc</tt> and <tt>ff_memfree</tt>) need to be added to the project.</p> <p>This option switches the long file name (LFN) extension and which memory to be allocated for the working buffer. When enable the LFN, Unicode support module <tt>ffunicode.c</tt> need to be added to the project. When use stack for the working buffer, take care on stack usage. When use heap memory for the working buffer, memory management functions (<tt>ff_memalloc</tt> and <tt>ff_memfree</tt>) need to be added to the project.</p>
<table class="lst1"> <table class="lst1">
<tr><th>Value</th><th>Description</th></tr> <tr><th>Value</th><th>Description</th></tr>
<tr><td>0</td><td>Disable LFN. Path name in only 8.3 format can be used.</td></tr> <tr><td>0</td><td>Disable LFN. Path name in only 8.3 format can be used.</td></tr>
@ -180,7 +181,7 @@
</table> </table>
<h4 id="max_lfn">FF_MAX_LFN</h4> <h4 id="max_lfn">FF_MAX_LFN</h4>
<p>LFN function requiers certain internal working buffer for the file name. This option defines size of the buffer and the value can be in range of 12 to 255 characters (actually in UTF-16 code units) of the LFN. The buffer occupies <tt>(FF_MAX_LFN + 1) * 2</tt> bytes and additional <tt>(FF_MAX_LFN + 44) / 15 * 32</tt> bytes when exFAT is enabled. It is recommended to be set 255 to fully support the LFN specification. This option has no effect when LFN is not enabled.</p> <p>LFN extension requiers a certain internal working buffer for the file name. This option defines size of the buffer and the value can be in range of 12 to 255 characters (actually in UTF-16 code unit) of the LFN. The working buffer occupies <tt>(FF_MAX_LFN + 1) * 2</tt> bytes and additional <tt>(FF_MAX_LFN + 44) / 15 * 32</tt> bytes when exFAT is enabled. It is recommended to be set 255 to fully satisfy the LFN specification. This option has no effect when LFN is not enabled.</p>
<h4 id="lfn_unicode">FF_LFN_UNICODE</h4> <h4 id="lfn_unicode">FF_LFN_UNICODE</h4>
<p>This option switches character encoding for the file name on the API. FatFs supports the code point up to U+10FFFF. This option also affects behavior of string I/O functions (see <tt>FF_STRF_ENCODE</tt>).</p> <p>This option switches character encoding for the file name on the API. FatFs supports the code point up to U+10FFFF. This option also affects behavior of string I/O functions (see <tt>FF_STRF_ENCODE</tt>).</p>
@ -191,7 +192,7 @@
<tr><td>2</td><td>Unicode in UTF-8</td><td>char</td></tr> <tr><td>2</td><td>Unicode in UTF-8</td><td>char</td></tr>
<tr><td>3</td><td>Unicode in UTF-32</td><td>DWORD</td></tr> <tr><td>3</td><td>Unicode in UTF-32</td><td>DWORD</td></tr>
</table> </table>
<p>When Unicode is selected, <tt>FF_CODE_PAGE</tt> has actually no meaning except for compatibility with legacy systems, such as MS-DOS and any system without support for LFN.</p> <p>When Unicode is selected, <tt>FF_CODE_PAGE</tt> has actually no meaning except for compatibility with legacy systems, such as MS-DOS and the systems without support for LFN.</p>
<p>When LFN is not enabled, this option has no effect and FatFs works in ANSI/OEM code on the API. For more information, read <a href="filename.html#uni">here</a>.</p> <p>When LFN is not enabled, this option has no effect and FatFs works in ANSI/OEM code on the API. For more information, read <a href="filename.html#uni">here</a>.</p>
<h4 id="lfn_buf">FF_LFN_BUF, FF_SFN_BUF</h4> <h4 id="lfn_buf">FF_LFN_BUF, FF_SFN_BUF</h4>
@ -203,17 +204,21 @@
<tr><td>Unicode in UTF-16/32</td><td>255 items</td><td>12 items</td></tr> <tr><td>Unicode in UTF-16/32</td><td>255 items</td><td>12 items</td></tr>
<tr><td>Unicode in UTF-8</td><td>765 items</td><td>34 items</td></tr> <tr><td>Unicode in UTF-8</td><td>765 items</td><td>34 items</td></tr>
</table> </table>
<p>If the size of name member is insufficient for the LFN, the item is treated as without LFN. When LFN is not enabled, these options have no effect.</p> <p>If the size of <tt>fname[]</tt> is insufficient for the LFN, the directory item is treated as without LFN. When LFN is not enabled, these options have no effect.</p>
<h4 id="fs_rpath">FF_FS_RPATH</h4> <h4 id="fs_rpath">FF_RPATH</h4>
<p>This option configures relative path function. For more information, read <a href="filename.html#nam">here</a>.</p> <p>This option configures relative path functions. For more information about relative path, read <a href="filename.html#nam">here</a>.</p>
<table class="lst1"> <table class="lst1">
<tr><th>Value</th><th>Description</th></tr> <tr><th>Value</th><th>Description</th></tr>
<tr><td>0</td><td>Disable relative path and remove related functions.</td></tr> <tr><td>0</td><td>Disable relative path and remove related APIs.</td></tr>
<tr><td>1</td><td>Enable relative path. <tt>f_chdir</tt> and <tt>f_chdrive</tt> function is available.</td></tr> <tr><td>1</td><td>Enable relative path. <tt>f_chdir</tt> and <tt>f_chdrive</tt> are available.</td></tr>
<tr><td>2</td><td><tt>f_getcwd</tt> function is available in addition to 1</td></tr> <tr><td>2</td><td><tt>f_getcwd</tt> is available in addition.</td></tr>
</table> </table>
<h4 id="fs_depth">FF_PATH_DEPTH</h4>
<p>This option defines maximum depth of directory in the path name on the exFAT volume. For example, <tt>FF_PATH_DEPTH = 3</tt> will able to follow a path <tt>"/dir1/dir2/dir3/file"</tt> but sub-directories in the <tt>dir3</tt> will not able to be followed and set current directory. This is NOT relevant to FAT/FAT32 volume.</p>
<p>The size of filesystem object (<tt>FATFS</tt>) increases <tt>FF_PATH_DEPTH * 24</tt> bytes to store the current directory path. When <tt>FF_FS_EXFAT == 0</tt> or <tt>FF_FS_RPATH == 0</tt>, this option has no effect.</p>
</div> </div>
@ -224,12 +229,12 @@
<p>This option configures number of volumes (logical drives up to 10) to be used.</p> <p>This option configures number of volumes (logical drives up to 10) to be used.</p>
<h4 id="str_volume_id">FF_STR_VOLUME_ID</h4> <h4 id="str_volume_id">FF_STR_VOLUME_ID</h4>
<p>This option switches the support for string volume ID. When arbitrary string for the volume ID is enabled for the drive prefix, also pre-defined strings by <tt>FF_VOLUME_STRS</tt> or user defined strings can be used as drive prefix in the path name. Numeric drive number is always valid regardless of this option, and also either format of drive prefix can be enabled by this option.</p> <p>This option switches the support for string volume ID. When arbitrary string for the volume ID is enabled for the drive prefix, also pre-defined strings by <tt>FF_VOLUME_STRS</tt> or user defined strings can be used as drive prefix in the path name. DOS/Windows style numeric volume ID is always valid regardless of this option, and also either format of drive prefix can be enabled by this option.</p>
<table class="lst2"> <table class="lst2">
<tr><th>Value</th><th>Description</th><th>Example</th></tr> <tr><th>Value</th><th>Description</th><th>Example</th></tr>
<tr><td>0</td><td>DOS/Windows style drive prefix in numeric ID.</td><td>1:/filename</td></tr> <tr><td>0</td><td>DOS/Windows style drive prefix in numeric ID.</td><td><em>1:</em>/filename</td></tr>
<tr><td>1</td><td>0 + DOS/Windows style drive prefix in arbitry string ID.</td><td>flash:/filename</td></tr> <tr><td>1</td><td>0 + DOS/Windows style drive prefix in arbitry string ID.</td><td><em>flash:</em>/filename</td></tr>
<tr><td>2</td><td>0 + Unix style drive prefix in arbitry string ID.</td><td>/flash/filename</td></tr> <tr><td>2</td><td>0 + Unix style drive prefix in arbitry string ID.</td><td><em>/flash</em>/filename</td></tr>
</table> </table>
<h4 id="volume_strs">FF_VOLUME_STRS</h4> <h4 id="volume_strs">FF_VOLUME_STRS</h4>
@ -272,7 +277,7 @@ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb"};
<h4 id="nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</h4> <h4 id="nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</h4>
<p>This set of options defines the time to be used in no RTC systems. This option has no effect in read-only configuration or <tt>FF_FS_NORTC == 0</tt>.</p> <p>This set of options defines the time to be used in no RTC systems. This option has no effect in read-only configuration or <tt>FF_FS_NORTC == 0</tt>.</p>
<h4 id="fs_ctime">FF_FS_CTIME</h4> <h4 id="fs_ctime">FF_FS_CRTIME</h4>
<p>This option enables (1) or disables (0) to access the file creation time with <tt>FILINFO</tt> structure.</p> <p>This option enables (1) or disables (0) to access the file creation time with <tt>FILINFO</tt> structure.</p>
<h4 id="fs_nofsinfo">FF_FS_NOFSINFO</h4> <h4 id="fs_nofsinfo">FF_FS_NOFSINFO</h4>
@ -302,6 +307,6 @@ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb"};
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -40,6 +40,6 @@ DSTATUS disk_initialize (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -94,6 +94,6 @@ DRESULT disk_ioctl (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -66,6 +66,6 @@ DRESULT disk_read (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -42,6 +42,6 @@ DSTATUS disk_status (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -69,6 +69,6 @@ DRESULT disk_write (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -56,6 +56,6 @@ int f_eof (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -56,6 +56,6 @@ int f_error (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -111,6 +111,6 @@ FRESULT f_expand (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -73,6 +73,6 @@ DWORD get_fattime (void)
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -89,6 +89,6 @@ FRESULT f_fdisk (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -12,12 +12,12 @@
<div class="para doc" id="nam"> <div class="para doc" id="nam">
<h3>Format of the Path Names</h3> <h3>Format of the Path Names</h3>
<p>The format of path name on the FatFs module is similer to the filename specs of DOS/Windos as follows:</p> <p>The format of path name (path to an object (file or sub-directory)) on the FatFs module is similer to the file name specs of DOS/Windos as follows:</p>
<pre>[<em>drive#</em>:][/]<em>directory</em>/<em>file</em></pre> <pre>[<em>drive#</em>:][/]<em>directory</em>/<em>file</em></pre>
<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when <tt><a href="config.html#use_lfn">FF_USE_LFN</a> &gt;= 1</tt>. The sub-directories are separated with a <tt>\</tt> or <tt>/</tt> as the same way as DOS/Windows API. Duplicated separator and terminating separator, such as <tt>"/<em>/</em>animal/<em>//</em>cat<em>/</em>"</tt>, are ignored. Only a difference is that the heading drive prefix to specify the <a href="#vol">logical drive</a>, an FAT volume, is in a digit (0-9) + a colon, while it is in an alphabet (A-Z) + a colon in DOS/Windows. The logical drive number is the identifier to specify the volume to be accessed. When drive prefix is omitted, the logical drive number is assumed as <em>default drive</em>.</p> <p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when <tt><a href="config.html#use_lfn">FF_USE_LFN</a> &gt;= 1</tt>. The sub-directories are separated with a <tt>\</tt> or <tt>/</tt> as the same way as DOS/Windows API. Duplicated separator and terminating separator, such as <tt>"/<em>/</em>animal/<em>//</em>cat<em>/</em>"</tt>, are ignored. Only a difference is that the heading drive prefix to specify the <a href="#vol">logical drive</a> (FAT volume) is in a digit (0-9) + a colon, while it is in an alphabet (A-Z) + a colon in DOS/Windows API. The logical drive number is the identifier to specify the FAT volume to be accessed. When drive prefix is omitted, the logical drive number is assumed as <em>default drive</em>.</p>
<p>Control characters (<tt>\0</tt> to <tt>\x1F</tt>) are recognized as end of the path name. In LFN configuration, leading or embedded white spaces in the file name are valid as part of the file name, but the treminating white space and dot of the file name are ignored and truncated. In non-LFN configuration, white space is recognized as end of the path name.</p> <p>Control characters (<tt>\0</tt> to <tt>\x1F</tt>) are recognized as end of the path name. In LFN configuration, leading or embedded white spaces and dots in the file name are valid as part of the file name, but the treminating white space and dot of the file name are ignored and truncated. In non-LFN configuration, white space is recognized as end of the path name.</p>
<p>In default configuration (<tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> == 0</tt>), it does not have a concept of current directory like OS oriented filesystem. Every object on the volume is always specified in full path name followed from the root directory. Dot directory names (<tt>".", ".."</tt>) are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive is fixed to drive 0.</p> <p>In default configuration (<tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> == 0</tt>), it does not have a concept of current directory like OS oriented filesystems. Every object on the volume is always specified in absolute path name that followed from the root directory. Dot directory names (<tt>"." and ".."</tt>) are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive is fixed to drive 0.</p>
<p>When relative path feature is enabled (<tt>FF_FS_RPATH &gt;= 1</tt>), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory of the default drive. Dot directory name is also allowed for the path name. The current directory is set by <a href="chdir.html"><tt>f_chdir</tt></a> function and the default drive is the current drive set by <a href="chdrive.html"><tt>f_chdrive</tt></a> function.</p> <p>When relative path feature is enabled (<tt>FF_FS_RPATH &gt;= 1</tt>), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory. Dot directory names (not the object but to refer this directory or parent directory) are also allowed for the path name. The current directory is set by <a href="chdir.html"><tt>f_chdir</tt></a> function and the default drive is the current drive set by <a href="chdrive.html"><tt>f_chdrive</tt></a> function.</p>
<table class="lst2"> <table class="lst2">
<tr><td>Path name</td><td>FF_FS_RPATH == 0</td><td>FF_FS_RPATH &gt;= 1</td></tr> <tr><td>Path name</td><td>FF_FS_RPATH == 0</td><td>FF_FS_RPATH &gt;= 1</td></tr>
<tr class="lst3"><td>file.txt</td><td>A file in the root directory of the drive 0</td><td>A file in the current directory of the current drive</td></tr> <tr class="lst3"><td>file.txt</td><td>A file in the root directory of the drive 0</td><td>A file in the current directory of the current drive</td></tr>
@ -27,22 +27,20 @@
<tr><td>2:</td><td>The root directory of the drive 2</td><td>The current directory of the drive 2</td></tr> <tr><td>2:</td><td>The root directory of the drive 2</td><td>The current directory of the drive 2</td></tr>
<tr><td>2:/</td><td>The root directory of the drive 2</td><td>The root directory of the drive 2</td></tr> <tr><td>2:/</td><td>The root directory of the drive 2</td><td>The root directory of the drive 2</td></tr>
<tr><td>2:file.txt</td><td>A file in the root directory of the drive 2</td><td>A file in the current directory of the drive 2</td></tr> <tr><td>2:file.txt</td><td>A file in the root directory of the drive 2</td><td>A file in the current directory of the drive 2</td></tr>
<tr><td>../file.txt</td><td>Invalid name</td><td>A file in the parent directory</td></tr>
<tr><td>.</td><td>Invalid name</td><td>This directory</td></tr> <tr><td>.</td><td>Invalid name</td><td>This directory</td></tr>
<tr><td>..</td><td>Invalid name</td><td>Parent directory of the current directory (*)</td></tr> <tr><td>..</td><td>Invalid name</td><td>Parent directory</td></tr>
<tr><td>dir1/..</td><td>Invalid name</td><td>The current directory</td></tr> <tr><td>../file.txt</td><td>Invalid name</td><td>A file in the parent directory</td></tr>
<tr><td>/..</td><td>Invalid name</td><td>The root directory (sticks the top level)</td></tr> <tr><td>/..</td><td>Invalid name</td><td>The root directory (sticks the top level)</td></tr>
</table> </table>
<p>Also the drive prefix can be in pre-defined arbitrary string. When the option <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a> == 1</tt>, also arbitrary string volume ID can be used as drive prefix. e.g. <tt>"<em>flash:</em>file1.txt"</tt>, <tt>"<em>ram:</em>temp.dat"</tt> or <tt>"<em>sd:</em>"</tt>. If the srting does not match any volume ID, the function fails with <tt>FR_INVALID_DRIVE</tt>.</p> <p>The drive prefix can be in pre-defined arbitrary string. When the option <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a> == 1</tt>, also arbitrary string volume ID can be used as drive prefix. e.g. <tt>"<em>flash:</em>file1.txt"</tt>, <tt>"<em>ram:</em>temp.dat"</tt> or <tt>"<em>sd:</em>"</tt>. If the srting does not match any volume ID, the function fails with <tt>FR_INVALID_DRIVE</tt>.</p>
<p>When <tt>FF_STR_VOLUME_ID == 2</tt>, Unix style drive prefix can be used. e.g. <tt>"<em>/flash</em>/file1.txt"</tt>, <tt>"<em>/ram</em>/temp.dat"</tt> or <tt>"<em>/sd</em>"</tt>. If a heading separator is exist, it is treated as an absolute path with a heading node ID. Any form as "root directory in current drive" and "current directory in specified drive" cannot be used. Double dot name cannot traverse the volumes such as <tt>"<em>/flash</em>/..<em>/ram</em>/foo.dat"</tt>.</p> <p>When <tt>FF_STR_VOLUME_ID == 2</tt>, Unix style drive prefix can be used. e.g. <tt>"<em>/flash</em>/file1.txt"</tt>, <tt>"<em>/ram</em>/temp.dat"</tt> or <tt>"<em>/sd</em>"</tt>. If a heading separator is exist, it is treated as an absolute path with a heading volume ID. Any form as "root directory in current drive" and "current directory in specified drive" cannot be used. ".." cannot traverse the volumes such as <tt>"<em>/flash</em>/..<em>/ram</em>/foo.dat"</tt>.</p>
<p><em>Remark: In this revision, double dot name <tt>".."</tt> cannot follow the parent directory on the exFAT volume. It will work as <tt>"."</tt> and stay there.</em></p>
</div> </div>
<div class="para doc" id="case"> <div class="para doc" id="case">
<h3>Legal Characters and Case Sensitivity</h3> <h3>Legal Characters and Case Sensitivity</h3>
<p>In the generic FAT filesystems, the legal characters for object name (file/directory name) are, <tt>0-9 A-Z ! # $ % &amp; ' ( ) - @ ^ _ ` { } ~</tt> in ASCII and extended characters <tt>\x80</tt> to <tt>\xFF</tt>. In the FAT filesystems with LFN extention, also <tt>+ , ; = [ ]</tt>, white space and extended characters <tt>U+000080</tt> to <tt>U+10FFFF</tt> are legal for the object name. White spaces and dots can be placed anywhere in the path name except end of the name. Trailing white spaces and dots are ignored.</p> <p>In the generic FAT filesystems, the legal characters for the object (file or sub-directory) name are, <tt>0-9 A-Z ! # $ % &amp; ' ( ) - @ ^ _ ` { } ~</tt> in ASCII and extended characters <tt>\x80</tt> to <tt>\xFF</tt>. In the FAT filesystems with LFN extention, also <tt>+ , ; = [ ]</tt>, white space and extended characters <tt>U+000080</tt> to <tt>U+10FFFF</tt> are legal for the object name. White spaces and dots can be placed anywhere in the path name except end of the name. Trailing white spaces and dots are ignored.</p>
<p>FAT filesystem is case-insensitive to the object names on the volume. Object names on the FAT volume are compared in case-insensitive. For instance, these three names, <tt>file.txt</tt>, <tt>File.Txt</tt> and <tt>FILE.TXT</tt>, are identical on the FAT filesystem. This is applied to extended charactres as well. When an object is created on the FAT volume, up converted name is recorded to the SFN entry, and the original name is recorded to the LFN entry if LFN extension is enabled.</p> <p>FAT filesystem is case-insensitive to the object names on the volume. Object names on the FAT volume are compared in case-insensitive. For instance, these three object names, <tt>file.txt</tt>, <tt>File.Txt</tt> and <tt>FILE.TXT</tt>, are identical on the FAT filesystem. This is applied to the extended charactres as well. When an object is created on the FAT volume, up converted name is recorded to the SFN entry, and the original name is recorded to the LFN entry if LFN extension is enabled.</p>
<p>On the MS-DOS and PC DOS for Chinese, Japanese and Korean (DOS/DBCS), extended characters are recorded to the SFN entry without up-case conversion and compared in case-sensitive. This causes a problem on compatibility with Windows system when the object with extended characters is created on the volume by DOS/DBCS system; therfore the object names with DBCS extended characters should not be used on the FAT volume shared by those systems. FatFs works with case-sensitive to the extended characters in only non-LFN with DBCS configuration (DOS/DBCS specs). However, FatFs works with case-insensitive to the extended character (WindowsNT specs) in LFN configuration.</p> <p>On the MS-DOS and PC DOS for Chinese, Japanese and Korean (DOS/DBCS), extended characters are recorded to the SFN entry without up-case conversion and compared in case-sensitive. This causes a problem on compatibility with Windows system when the file with extended characters is created on the volume by DOS/DBCS system; therfore the object names with DBCS extended characters should not be used on the FAT volume shared by those systems. FatFs works with case-sensitive to the extended characters in only non-LFN with DBCS configuration (DOS/DBCS specs). However, FatFs works with case-insensitive to the extended character (WindowsNT specs) in LFN configuration.</p>
</div> </div>
<div class="para doc" id="uni"> <div class="para doc" id="uni">
@ -71,10 +69,8 @@ PARTITION VolToPart[FF_VOLUMES] = {
{0, 3}, <span class="c">/* "2:" ==> 3rd partition on the pd#0 */</span> {0, 3}, <span class="c">/* "2:" ==> 3rd partition on the pd#0 */</span>
{1, 0} <span class="c">/* "3:" ==> pd#1 as removable drive (auto-search) */</span> {1, 0} <span class="c">/* "3:" ==> pd#1 as removable drive (auto-search) */</span>
}; };
<img src="../res/f7.png" width="900" height="288" alt="relationship between logical drive and physical drive">
</pre> </pre>
<img src="../res/f7.png" width="900" height="288" alt="relationship between logical drive and physical drive">
<p>There are some considerations when enable the multi-partition configuration.</p> <p>There are some considerations when enable the multi-partition configuration.</p>
<ul> <ul>
<li>The physical drive that hosts two or more mounted partitions should be non-removable, or all volumes on the drive must be unmounted when remove the medium.</li> <li>The physical drive that hosts two or more mounted partitions should be non-removable, or all volumes on the drive must be unmounted when remove the medium.</li>
@ -88,6 +84,6 @@ PARTITION VolToPart[FF_VOLUMES] = {
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -111,6 +111,6 @@ void find_image_file (void)
<p><tt><a href="findnext.html">f_findnext</a>, <a href="closedir.html">f_closedir</a>, <a href="sdir.html">DIR</a>, <a href="sfileinfo.html">FILINFO</a></tt></p> <p><tt><a href="findnext.html">f_findnext</a>, <a href="closedir.html">f_closedir</a>, <a href="sdir.html">DIR</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -63,6 +63,6 @@ FRESULT f_findnext (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -133,6 +133,6 @@ FRESULT play_file (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -11,11 +11,11 @@
<div class="para func"> <div class="para func">
<h2>f_getcwd</h2> <h2>f_getcwd</h2>
<p>The f_getcwd function retrieves the current directory of the current drive.</p> <p>The f_getcwd function retrieves the current directory and current drive.</p>
<pre> <pre>
FRESULT f_getcwd ( FRESULT f_getcwd (
TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] Buffer to return path name */</span> TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] Buffer to return path name */</span>
UINT <span class="arg">len</span> <span class="c">/* [IN] The length of the buffer */</span> UINT <span class="arg">len</span> <span class="c">/* [IN] Buffer length */</span>
); );
</pre> </pre>
</div> </div>
@ -24,9 +24,9 @@ FRESULT f_getcwd (
<h4>Parameters</h4> <h4>Parameters</h4>
<dl class="par"> <dl class="par">
<dt>buff</dt> <dt>buff</dt>
<dd>Pointer to the buffer to receive the current directory string.</dd> <dd>Pointer to the string buffer to receive the current directory path.</dd>
<dt>len</dt> <dt>len</dt>
<dd>Size of the buffer in unit of <tt>TCHAR</tt>.</dd> <dd>Size of the buffer in unit of <tt>(TCHAR)</tt>.</dd>
</dl> </dl>
</div> </div>
@ -49,7 +49,6 @@ FRESULT f_getcwd (
<div class="para desc"> <div class="para desc">
<h4>Description</h4> <h4>Description</h4>
<p>The <tt>f_getcwd</tt> function retrieves full path name of the current directory of the current drive. When <tt><a href="config.html#volumes">FF_VOLUMES</a> &gt;= 2</tt>, a heading drive prefix is added to the path name. The style of drive prefix depends on <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a></tt>.</p> <p>The <tt>f_getcwd</tt> function retrieves full path name of the current directory of the current drive. When <tt><a href="config.html#volumes">FF_VOLUMES</a> &gt;= 2</tt>, a heading drive prefix is added to the path name. The style of drive prefix depends on <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a></tt>.</p>
<p><em>Note: In this revision, this function cannot retrieve the current directory path on the exFAT volume. It always returns the root directory path.</em></p>
</div> </div>
@ -77,6 +76,6 @@ FRESULT f_getcwd (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -87,6 +87,6 @@ FRESULT f_getfree (
<p><tt><a href="sfatfs.html">FATFS</a></tt></p> <p><tt><a href="sfatfs.html">FATFS</a></tt></p>
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -83,6 +83,6 @@ FRESULT f_getlabel (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -59,6 +59,6 @@ TCHAR* f_gets (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

11
documents/doc/index.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="refresh" content="0; url=../">
</head>
<body>
</body>
</html>

View File

@ -134,6 +134,6 @@ FRESULT f_rewind (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -74,6 +74,6 @@ FRESULT f_mkdir (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -121,6 +121,6 @@ int main (void)
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -30,11 +30,11 @@ FRESULT f_unmount (
<h4>Parameters</h4> <h4>Parameters</h4>
<dl class="par"> <dl class="par">
<dt>fs</dt> <dt>fs</dt>
<dd>Pointer to the filesystem object to be registered and cleared. Null pointer unregisters the registered filesystem object.</dd> <dd>Pointer to the filesystem object to be registered and cleared. A null pointer unregisters the registered filesystem object.</dd>
<dt>path</dt> <dt>path</dt>
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. The string without drive number means the default drive.</dd> <dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. The string without drive number means the default drive.</dd>
<dt>opt</dt> <dt>opt</dt>
<dd>Mounting option. 0: Do not mount now (to be mounted on the first access to the volume), 1: Force mounted the volume to check if it is ready to work.</dd> <dd>Mounting option. 0: Do not mount now (to be mounted on the first access to the volume), 1: Force mounted the volume to check if it is ready to work. If <tt class="arg">fs</tt> is a NULL, this argument has no meaning.</dd>
</dl> </dl>
</div> </div>
@ -53,7 +53,7 @@ FRESULT f_unmount (
<div class="para desc"> <div class="para desc">
<h4>Description</h4> <h4>Description</h4>
<p>FatFs requires work area (<em>filesystem object</em>) for each logical drives (FAT volumes). Prior to perform any file/directory operations, a filesystem object needs to be registered with <tt>f_mount</tt> function for the logical drive. The file/directory API functions get ready to work after this procedure. Some volume management functions, <tt>f_mkfs</tt>, <tt>f_fdisk</tt> and <tt>f_setcp</tt>, do not want a filesystem object.</p> <p>FatFs requires work area (<em>filesystem object</em>) for each logical drive (FAT volume). Prior to perform file/directory operations, a filesystem object needs to be registered with <tt>f_mount</tt> function for the logical drive. The file/directory API functions get ready to work after this procedure. Some volume management functions, <tt>f_mkfs</tt>, <tt>f_fdisk</tt> and <tt>f_setcp</tt>, do not want a filesystem object.</p>
<p>The <tt>f_mount</tt> function registers/unregisters a filesystem object to the FatFs module as follows:</p> <p>The <tt>f_mount</tt> function registers/unregisters a filesystem object to the FatFs module as follows:</p>
<ol> <ol>
<li>Determines the logical drive which specified by <tt class="arg">path</tt>.</li> <li>Determines the logical drive which specified by <tt class="arg">path</tt>.</li>
@ -61,14 +61,14 @@ FRESULT f_unmount (
<li>Clears and registers the new work area to the volume if <tt class="arg">fs</tt> is not NULL.</li> <li>Clears and registers the new work area to the volume if <tt class="arg">fs</tt> is not NULL.</li>
<li>Performs volume mount process to the volume if forced mounting is specified.</li> <li>Performs volume mount process to the volume if forced mounting is specified.</li>
</ol> </ol>
<p>If there is any open object of file or directory on the logical drive, the object will be invalidated by this function.</p> <p>If there are open objects of file or directory on the logical drive, they will be invalidated by this function.</p>
<p>If forced mounting is not specified (<tt>opt = 0</tt>), this function always succeeds regardless of the physical drive status. It only clears (de-initializes) the given work area and registers its address to the internal table and no activity of the physical drive in this function. The volume mount process will be attempted on subsequent file/directroy function if the filesystem object is not initialized. (delayed mounting) The volume mount processes, initialize the corresponding physical drive, find the FAT volume in it and then initialize the work area, is performed in the subsequent file/directory functions when either of following conditions is true.</p> <p>If forced mounting is not specified (<tt>opt = 0</tt>), this function always succeeds regardless of the physical drive status. It only clears (de-initializes) the given work area and registers its address to the internal table. There is no action to the physical drive in this function. The volume mount process will be attempted on subsequent file/directroy function if the filesystem object is not initialized. (delayed mounting) The volume mount processes, initialize the corresponding physical drive, find the FAT volume in it and then initialize the work area, is performed in the subsequent file/directory functions when either of following conditions is true.</p>
<ul> <ul>
<li>Filesystem object has not been initialized. It is de-initialized by <tt>f_mount</tt> function.</li> <li>The filesystem object has not been initialized. It is de-initialized by <tt>f_mount</tt> function.</li>
<li>Physical drive is not initialized. It is de-initialized by system reset or media removal.</li> <li>The physical drive is not initialized. It is de-initialized by system reset or media removal.</li>
</ul> </ul>
<p>If the function with forced mounting (<tt>opt = 1</tt>) failed with <tt>FR_NOT_READY</tt>, it means that the filesystem object has been registered successfully but the volume is currently not ready to work. The volume mount process will be attempted on subsequent file/directroy function.</p> <p>If the function with forced mounting (<tt>opt = 1</tt>) failed with <tt>FR_NOT_READY</tt>, it means that the filesystem object has been registered successfully but the volume is currently not ready to work. The volume mount process will be attempted on subsequent file/directroy function.</p>
<p>If implementation of the disk I/O layer lacks asynchronous media change detection, application program needs to perform <tt>f_mount</tt> function after each media change to force cleared the filesystem object.</p> <p>If implementation of the disk I/O layer lacks asynchronous media change detection, the application program needs to perform <tt>f_mount</tt> function after each media change to force cleared the filesystem object.</p>
<p>To unregister the work area, specify a NULL to the <tt class="arg">fs</tt>, and then the work area can be discarded. <tt>f_unmount</tt> function is implemented as a macro.</p> <p>To unregister the work area, specify a NULL to the <tt class="arg">fs</tt>, and then the work area can be discarded. <tt>f_unmount</tt> function is implemented as a macro.</p>
<pre> <pre>
#define <em>f_unmount</em>(path) f_mount(0, path, 0) #define <em>f_unmount</em>(path) f_mount(0, path, 0)
@ -116,6 +116,6 @@ int main (void)
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -180,6 +180,6 @@ int main (void)
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -69,6 +69,6 @@ FRESULT f_opendir (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -109,6 +109,6 @@ int f_printf (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -54,6 +54,6 @@ int f_putc (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -55,6 +55,6 @@ int f_puts (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -17,7 +17,7 @@
<dd>The function succeeded.</dd> <dd>The function succeeded.</dd>
<dt id="de">FR_DISK_ERR</dt> <dt id="de">FR_DISK_ERR</dt>
<dd>The lower layer, <tt>disk_read</tt>, <tt>disk_write</tt> or <tt>disk_ioctl</tt> function, reported that an unrecoverable hard error occured.<br>Note that if once this error occured at any operation to an open file, the file object is aborted and any operations to the file except for close will be rejected.</dd> <dd>The lower layer, <tt>disk_read</tt>, <tt>disk_write</tt> or <tt>disk_ioctl</tt> function, reported that an unrecoverable hard error occured.<br>Note that if once this error occured in the operation to an open file, the file object is aborted and any operations to the file except <tt>f_close</tt> will be rejected.</dd>
<dt id="ie">FR_INT_ERR</dt> <dt id="ie">FR_INT_ERR</dt>
<dd>Assertion failed and an insanity is detected in the internal process. One of the following possibilities is suspected. <dd>Assertion failed and an insanity is detected in the internal process. One of the following possibilities is suspected.
@ -27,7 +27,7 @@
<li>There is a bug in the FatFs module itself.</li> <li>There is a bug in the FatFs module itself.</li>
<li>Wrong lower layer implementation.</li> <li>Wrong lower layer implementation.</li>
</ul> </ul>
Note that if once this error occured in the operation to an open file, the file object is aborted and any operation to the file except for close will be rejected. Note that if once this error occured in the operation to an open file, the file object is aborted and any operation to the file except <tt>f_close</tt> will be rejected.
</dd> </dd>
<dt id="nr">FR_NOT_READY</dt> <dt id="nr">FR_NOT_READY</dt>
@ -44,14 +44,14 @@ Note that if once this error occured in the operation to an open file, the file
<dd>Could not find the file in the directory.</dd> <dd>Could not find the file in the directory.</dd>
<dt id="np">FR_NO_PATH</dt> <dt id="np">FR_NO_PATH</dt>
<dd>Could not find the path. A directory in the path name could not be found.</dd> <dd>Could not follow the path. A sub-directory in the path name could not be found.</dd>
<dt id="in">FR_INVALID_NAME</dt> <dt id="in">FR_INVALID_NAME</dt>
<dd>The given string is invalid as a <a href="filename.html">path name</a>. One of the following possibilities is suspected. <dd>The given string is invalid as a <a href="filename.html">path name</a>. One of the following possibilities is suspected.
<ul> <ul>
<li>There is a character not allowed for the file name.</li> <li>There is a character not allowed for the file name .</li>
<li>The file name is out of 8.3 format. (at non-LFN cfg.)</li> <li>The file name is out of 8.3 format. (at non-LFN cfg.)</li>
<li><tt>FF_MAX_LFN</tt> is insufficient for the file name. (at LFN cfg.)</li> <li><tt>FF_MAX_LFN</tt> is insufficient for the length of file name. (at LFN cfg.)</li>
<li>There is a character encoding error in the string.</li> <li>There is a character encoding error in the string.</li>
</ul> </ul>
</dd> </dd>
@ -59,30 +59,30 @@ Note that if once this error occured in the operation to an open file, the file
<dt id="dn">FR_DENIED</dt> <dt id="dn">FR_DENIED</dt>
<dd>The required access was denied due to one of the following reasons: <dd>The required access was denied due to one of the following reasons:
<ul> <ul>
<li>Write mode open against the read-only file. (f_open)</li> <li>Write mode open against the read-only file. (<tt>f_open</tt>)</li>
<li>Deleting the read-only file or directory. (f_unlink)</li> <li>Deleting the read-only file or directory. (<tt>f_unlink</tt>)</li>
<li>Deleting the non-empty directory or current directory. (f_unlink)</li> <li>Deleting the non-empty directory or current directory. (<tt>f_unlink</tt>)</li>
<li>Reading the file opened without <tt>FA_READ</tt> flag. (f_read)</li> <li>Reading the file opened without <tt>FA_READ</tt> flag. (<tt>f_read</tt>)</li>
<li>Any modification to the file opened without <tt>FA_WRITE</tt> flag. (f_write, f_truncate, f_expand)</li> <li>Any modification to the file opened without <tt>FA_WRITE</tt> flag. (<tt>f_write, f_truncate, f_expand</tt>)</li>
<li>Could not create the object due to root directory full or disk full. (f_open, f_mkdir)</li> <li>Could not create the object due to root directory full or disk full. (<tt>f_open, f_mkdir</tt>)</li>
<li>Could not find a contiguous area for the file. (f_expand)</li> <li>Could not find a contiguous data area for the file. (<tt>f_expand</tt>)</li>
</ul> </ul>
</dd> </dd>
<dt id="ex">FR_EXIST</dt> <dt id="ex">FR_EXIST</dt>
<dd>Name collision. An object with the same name is already existing in the directory.</dd> <dd>Name collision. A file or sub-directory with the same name is already existing in the directory.</dd>
<dt id="io">FR_INVALID_OBJECT</dt> <dt id="io">FR_INVALID_OBJECT</dt>
<dd>The file/directory object is invalid or the pointer is null. There are some reasons as follows: <dd>The file/directory object is invalid or the pointer is null. There are some reasons as follows:
<ul> <ul>
<li>The file/directory has been closed.</li> <li>The file/directory object has been closed.</li>
<li>The file/directory object has been invalidated or the structure has been collapsed. Open objects on the volume will be invalidated by a voulme mount process.</li> <li>The file/directory object has been invalidated or the structure has been collapsed. Open objects on the volume will be invalidated by a voulme mount process.</li>
<li>Physical drive is not ready to work due to a media removal.</li> <li>Physical drive is not ready to work due to a media removal.</li>
</ul> </ul>
</dd> </dd>
<dt id="wp">FR_WRITE_PROTECTED</dt> <dt id="wp">FR_WRITE_PROTECTED</dt>
<dd>A write mode operation against the write-protected media.</dd> <dd>A write mode operation against the write-protected medium.</dd>
<dt id="id">FR_INVALID_DRIVE</dt> <dt id="id">FR_INVALID_DRIVE</dt>
<dd>Invalid drive number is specified in the path name or a null pointer is given as the path name. (Related option: <tt><a href="config.html#volumes">FF_VOLUMES</a></tt>)</dd> <dd>Invalid drive number is specified in the path name or a null pointer is given as the path name. (Related option: <tt><a href="config.html#volumes">FF_VOLUMES</a></tt>)</dd>
@ -111,13 +111,14 @@ Note that if once this error occured in the operation to an open file, the file
<dd>The function was canceled due to a timeout of <a href="appnote.html#reentrant">thread-safe control</a>. (Related option: <tt><a href="config.html#timeout">FF_TIMEOUT</a></tt>)</dd> <dd>The function was canceled due to a timeout of <a href="appnote.html#reentrant">thread-safe control</a>. (Related option: <tt><a href="config.html#timeout">FF_TIMEOUT</a></tt>)</dd>
<dt id="lo">FR_LOCKED</dt> <dt id="lo">FR_LOCKED</dt>
<dd>The operation to the object was rejected by <a href="appnote.html#dup">file sharing control</a>. (Related option: <tt><a href="config.html#fs_lock">FF_FS_LOCK</a></tt>)</dd> <dd>The operation to the file or sub-directory was rejected by <a href="appnote.html#dup">file sharing control</a>. (Related option: <tt><a href="config.html#fs_lock">FF_FS_LOCK</a></tt>)</dd>
<dt id="nc">FR_NOT_ENOUGH_CORE</dt> <dt id="nc">FR_NOT_ENOUGH_CORE</dt>
<dd>Not enough memory for the operation. There is one of the following reasons: <dd>Not enough memory for the operation. There is one of the following reasons:
<ul> <ul>
<li>Could not allocate a memory for LFN working buffer. (Related option: <tt><a href="config.html#use_lfn">FF_USE_LFN</a></tt>)</li> <li>Could not allocate a memory for LFN working buffer. (Related option: <tt><a href="config.html#use_lfn">FF_USE_LFN</a></tt>)</li>
<li>Size of the given buffer is insufficient for the size required.</li> <li>Size of the given buffer is insufficient for the size required.</li>
<li><tt><a href="config.html#fs_depth">FF_PATH_DEPTH</a></tt> is insufficient to follow the deep path. (on exFAT volume)</li>
</ul> </ul>
</dd> </dd>
@ -129,6 +130,6 @@ Note that if once this error occured in the operation to an open file, the file
</dl> </dl>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -74,6 +74,6 @@ FRESULT f_read (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -168,6 +168,6 @@ int main (void)
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -24,9 +24,9 @@ FRESULT f_rename (
<h4>Parameters</h4> <h4>Parameters</h4>
<dl class="par"> <dl class="par">
<dt>old_name</dt> <dt>old_name</dt>
<dd>Pointer to a null-terminated string that specifies the existing <a href="filename.html">file or sub-directory</a> to be renamed.</dd> <dd>Pointer to the null-terminated string that specifies the existing <a href="filename.html">file or sub-directory</a> to be renamed.</dd>
<dt>new_name</dt> <dt>new_name</dt>
<dd>Pointer to a null-terminated string that specifies the new object name. A drive number may be specified in this string but it is ignored and assumed as the same drive of the <tt class="arg">old_name</tt>. Any object with this path name except <tt class="arg">old_name</tt> must not be exist, or the function fails with <tt>FR_EXIST</tt>.</dd> <dd>Pointer to the null-terminated string that specifies the new object name. A drive number may be specified in this string but it is ignored and assumed as the same drive of the <tt class="arg">old_name</tt>. Any object with this name except <tt class="arg">old_name</tt> must not be exist, or the function fails with <tt>FR_EXIST</tt>.</dd>
</dl> </dl>
</div> </div>
@ -55,7 +55,9 @@ FRESULT f_rename (
<div class="para desc"> <div class="para desc">
<h4>Description</h4> <h4>Description</h4>
<p>Renames a file or sub-directory and can also move it to other directory in the same volume. The object to be renamed must not be an open object, or <em>the FAT volume can be collapsed</em>. Such the wrong operation is rejected safely when <a href="appnote.html#dup">file lock function</a> is enabled.</p> <p>Renames a file or sub-directory and can also move it to another directory in the same volume. The file to be renamed must not be an open file, or <em>the FAT volume can be collapsed</em>. Such the wrong file renaming is rejected safely when <a href="appnote.html#dup">file lock function</a> is enabled.</p>
<p>Any sub-directory in the current directory path should not be renamed. It will be rejected on the exFAT volume but succeeds on the FAT/FAT32 volume.</p>
<p><em>Remark: Be careful in moving a sub-directory. The sub-directory must not be moved into itself and any sub-directory in it, or the moved sub-directory will be lost.</em></p>
</div> </div>
@ -74,12 +76,12 @@ FRESULT f_rename (
<span class="c">/* Rename an object in the drive 2 */</span> <span class="c">/* Rename an object in the drive 2 */</span>
<em>f_rename</em>("2:oldname.txt", "newname.txt"); <em>f_rename</em>("2:oldname.txt", "newname.txt");
<span class="c">/* Rename an object and move it to another directory in the drive */</span> <span class="c">/* Rename an object and move it into another directory in the drive */</span>
<em>f_rename</em>("log.txt", "old/log0001.txt"); <em>f_rename</em>("log.txt", "old/log0001.txt");
</pre> </pre>
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -14,7 +14,7 @@
<p>The <tt>DIR</tt> structure is used for the work area to read a directory by <tt>f_oepndir</tt>, <tt>f_readdir</tt>, <tt>f_findfirst</tt> and <tt>f_findnext</tt> function. Application program <em>must not</em> modify any member in this structure, or <tt>f_readdir</tt> function will not work properly.</p> <p>The <tt>DIR</tt> structure is used for the work area to read a directory by <tt>f_oepndir</tt>, <tt>f_readdir</tt>, <tt>f_findfirst</tt> and <tt>f_findnext</tt> function. Application program <em>must not</em> modify any member in this structure, or <tt>f_readdir</tt> function will not work properly.</p>
<pre> <pre>
<span class="k">typedef</span> <span class="k">struct</span> { <span class="k">typedef</span> <span class="k">struct</span> {
FFOBJID obj; <span class="c">/* Object identifier */</span> <a href="sobjid.hrml">FFOBJID</a> obj; <span class="c">/* Object identifier */</span>
DWORD dptr; <span class="c">/* Current read/write offset */</span> DWORD dptr; <span class="c">/* Current read/write offset */</span>
DWORD clust; <span class="c">/* Current cluster */</span> DWORD clust; <span class="c">/* Current cluster */</span>
LBA_t sect; <span class="c">/* Current sector */</span> LBA_t sect; <span class="c">/* Current sector */</span>
@ -25,13 +25,13 @@
WCHAR* lfn; <span class="c">/* Pointer to the LFN working buffer (in/out) */</span> WCHAR* lfn; <span class="c">/* Pointer to the LFN working buffer (in/out) */</span>
<span class="k">#endif</span> <span class="k">#endif</span>
<span class="k">#if</span> FF_USE_FIND <span class="k">#if</span> FF_USE_FIND
const TCHAR* pat; <span class="c">/* Ponter to the matching pattern */</span> const TCHAR* pat; <span class="c">/* Ponter to the matching pattern */</span>
<span class="k">#endif</span> <span class="k">#endif</span>
} DIR; } DIR;
</pre> </pre>
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -75,6 +75,6 @@ FRESULT f_setcp (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -88,6 +88,6 @@ FRESULT f_setlabel (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -15,7 +15,8 @@
<pre> <pre>
<span class="k">typedef</span> <span class="k">struct</span> { <span class="k">typedef</span> <span class="k">struct</span> {
BYTE fs_type; <span class="c">/* FAT type (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */</span> BYTE fs_type; <span class="c">/* FAT type (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */</span>
BYTE pdrv; <span class="c">/* Hosting physical drive of this volume */</span> BYTE pdrv; <span class="c">/* Physical drive that holds this volume */</span>
BYTE ldrv; <span class="c">/* Logical drive number (used only when FF_FS_REENTRANT) */</span>
BYTE n_fats; <span class="c">/* Number of FAT copies (1,2) */</span> BYTE n_fats; <span class="c">/* Number of FAT copies (1,2) */</span>
BYTE wflag; <span class="c">/* win[] flag (b0:win[] is dirty) */</span> BYTE wflag; <span class="c">/* win[] flag (b0:win[] is dirty) */</span>
BYTE fsi_flag; <span class="c">/* FSINFO flags (b7:Disabled, b0:Dirty) */</span> BYTE fsi_flag; <span class="c">/* FSINFO flags (b7:Disabled, b0:Dirty) */</span>
@ -25,36 +26,36 @@
<span class="k">#if</span> FF_MAX_SS != FF_MIN_SS <span class="k">#if</span> FF_MAX_SS != FF_MIN_SS
WORD ssize; <span class="c">/* Sector size (512,1024,2048 or 4096) */</span> WORD ssize; <span class="c">/* Sector size (512,1024,2048 or 4096) */</span>
<span class="k">#endif</span> <span class="k">#endif</span>
<span class="k">#if</span> FF_FS_EXFAT <span class="k">#if</span> FF_USE_LFN
BYTE* dirbuf; <span class="c">/* Directory entry block scratchpad buffer */</span> WCHAR* lfnbuf; <span class="c">/* Pointer to LFN working buffer */</span>
<span class="k">#endif</span>
<span class="k">#if</span> FF_FS_REENTRANT
FF_SYNC_t sobj; <span class="c">/* Identifier of sync object */</span>
<span class="k">#endif</span> <span class="k">#endif</span>
<span class="k">#if</span> !FF_FS_READONLY <span class="k">#if</span> !FF_FS_READONLY
DWORD last_clust; <span class="c">/* FSINFO: Last allocated cluster (0xFFFFFFFF if invalid) */</span> DWORD last_clust; <span class="c">/* FSINFO: Last allocated cluster (invalid if &gt;=n_fatent) */</span>
DWORD free_clust; <span class="c">/* FSINFO: Number of free clusters (0xFFFFFFFF if invalid) */</span> DWORD free_clust; <span class="c">/* FSINFO: Number of free clusters (invalid if &gt;=fs->n_fatent-2) */</span>
<span class="k">#endif</span> <span class="k">#endif</span>
<span class="k">#if</span> FF_FS_RPATH <span class="k">#if</span> FF_FS_RPATH
DWORD cdir; <span class="c">/* Cluster number of current directory (0:root) */</span> DWORD cdir; <span class="c">/* Cluster number of current directory (0:root) */</span>
<span class="k">#if</span> FF_FS_EXFAT
DWORD cdc_scl; <span class="c">/* Containing directory start cluster (invalid when cdir is 0) */</span>
DWORD cdc_size; <span class="c">/* b31-b8:Size of containing directory, b7-b0: Chain status */</span>
DWORD cdc_ofs; <span class="c">/* Offset in the containing directory (invalid when cdir is 0) */</span>
<span class="k">#endif</span>
<span class="k">#endif</span> <span class="k">#endif</span>
DWORD n_fatent; <span class="c">/* Number of FAT entries (Number of clusters + 2) */</span> DWORD n_fatent; <span class="c">/* Number of FAT entries (Number of clusters + 2) */</span>
DWORD fsize; <span class="c">/* Sectors per FAT */</span> DWORD fsize; <span class="c">/* Sectors per FAT */</span>
LBA_t winsect; <span class="c">/* Sector LBA appearing in the win[] */</span>
LBA_t volbase; <span class="c">/* Volume base LBA */</span> LBA_t volbase; <span class="c">/* Volume base LBA */</span>
LBA_t fatbase; <span class="c">/* FAT base LBA */</span> LBA_t fatbase; <span class="c">/* FAT base LBA */</span>
LBA_t dirbase; <span class="c">/* Root directory base (LBA|Cluster) */</span> LBA_t dirbase; <span class="c">/* Root directory base (LBA|Cluster) */</span>
LBA_t database; <span class="c">/* Data base LBA */</span> LBA_t database; <span class="c">/* Data base LBA */</span>
LBA_t winsect; <span class="c">/* Sector LBA appearing in the win[] */</span> <span class="k">#if</span> FF_FS_EXFAT
LBA_t bitbase; <span class="c">/* Allocation bitmap base sector */</span>
BYTE* dirbuf; <span class="c">/* Directory entry block scratchpad buffer */</span>
<span class="k">#if</span> FF_FS_RPATH
<a href="sxcwds.html">FFXCWDS</a> xcwds; <span class="c">/* Current working directory structure */</span>
FFXCWDS xcwds2; <span class="c">/* Working buffer to follow the path */</span>
<span class="k">#endif</span>
<span class="k">#endif</span>
BYTE win[FF_MAX_SS]; <span class="c">/* Disk access window for directory, FAT (and file data at tiny cfg) */</span> BYTE win[FF_MAX_SS]; <span class="c">/* Disk access window for directory, FAT (and file data at tiny cfg) */</span>
} FATFS; } FATFS;
</pre> </pre>
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -15,18 +15,18 @@
<pre> <pre>
<span class="k">typedef</span> <span class="k">struct</span> { <span class="k">typedef</span> <span class="k">struct</span> {
FFOBJID obj; <span class="c">/* Object identifier */</span> <a href="sobjid.html">FFOBJID</a> obj; <span class="c">/* Object identifier */</span>
BYTE flag; <span class="c">/* File object status flags */</span> BYTE flag; <span class="c">/* File status flags */</span>
BYTE err; <span class="c">/* Abort flag (error code) */</span> BYTE err; <span class="c">/* Abort flag (error code) */</span>
FSIZE_t fptr; <span class="c">/* File read/write pointer (Byte offset origin from top of the file) */</span> FSIZE_t fptr; <span class="c">/* File read/write pointer (byte offset origin from top of the file; 0 on open) */</span>
DWORD clust; <span class="c">/* Current cluster of fptr (One cluster behind if fptr is on the cluster boundary. Invalid if fptr == 0.) */</span> DWORD clust; <span class="c">/* Current cluster of fptr (one cluster behind if fptr is on the cluster boundary; invalid if fptr == 0) */</span>
LBA_t sect; <span class="c">/* Current data sector (Can be invalid if fptr is on the cluster boundary.)*/</span> LBA_t sect; <span class="c">/* Current data sector (can be invalid if fptr is on the cluster boundary)*/</span>
<span class="k">#if</span> !FF_FS_READONLY <span class="k">#if</span> !FF_FS_READONLY
LBA_t dir_sect; <span class="c">/* Sector number containing the directory entry */</span> LBA_t dir_sect; <span class="c">/* Sector number containing the directory entry */</span>
BYTE* dir_ptr; <span class="c">/* Ponter to the directory entry in the window */</span> BYTE* dir_ptr; <span class="c">/* Pointer to the directory entry in the window */</span>
<span class="k">#endif</span> <span class="k">#endif</span>
<span class="k">#if</span> FF_USE_FASTSEEK <span class="k">#if</span> FF_USE_FASTSEEK
DWORD* cltbl; <span class="c">/* Pointer to the cluster link map table (Nulled on file open. Set by application.) */</span> DWORD* cltbl; <span class="c">/* Pointer to the cluster link map table (nulled on file open; set by application) */</span>
<span class="k">#endif</span> <span class="k">#endif</span>
<span class="k">#if</span> !FF_FS_TINY <span class="k">#if</span> !FF_FS_TINY
BYTE buf[FF_MAX_SS]; <span class="c">/* File private data transfer buffer (Always valid if fptr is not on the sector boundary but can be invalid if fptr is on the sector boundary.) */</span> BYTE buf[FF_MAX_SS]; <span class="c">/* File private data transfer buffer (Always valid if fptr is not on the sector boundary but can be invalid if fptr is on the sector boundary.) */</span>
@ -37,6 +37,6 @@
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -14,14 +14,14 @@
<p>The <tt>FILINFO</tt> structure holds information about the object retrieved by <tt>f_readdir</tt>, <tt>f_findfirst</tt>, <tt>f_findnext</tt> and <tt>f_stat</tt> function. Be careful in the size of structure when LFN is enabled.</p> <p>The <tt>FILINFO</tt> structure holds information about the object retrieved by <tt>f_readdir</tt>, <tt>f_findfirst</tt>, <tt>f_findnext</tt> and <tt>f_stat</tt> function. Be careful in the size of structure when LFN is enabled.</p>
<pre> <pre>
<span class="k">typedef struct</span> { <span class="k">typedef struct</span> {
FSIZE_t fsize; <span class="c">/* File size */</span> FSIZE_t fsize; <span class="c">/* File size (invalid for directory) */</span>
WORD fdate; <span class="c">/* Last modified date */</span> WORD fdate; <span class="c">/* Date of file modification or directory creation */</span>
WORD ftime; <span class="c">/* Last modified time */</span> WORD ftime; <span class="c">/* Time of file modification or directory creation */</span>
<span class="k">#if</span> FF_FS_CRTIME <span class="k">#if</span> FF_FS_CRTIME
WORD crdate; <span class="c">/* Created date */</span> WORD crdate; <span class="c">/* Date of object createion */</span>
WORD crtime; <span class="c">/* Created time */</span> WORD crtime; <span class="c">/* Time of object createion */</span>
<span class="k">#endif</span> <span class="k">#endif</span>
BYTE fattrib; <span class="c">/* Attribute */</span> BYTE fattrib; <span class="c">/* Object attribute */</span>
<span class="k">#if</span> FF_USE_LFN <span class="k">#if</span> FF_USE_LFN
TCHAR altname[FF_SFN_BUF + 1]; <span class="c">/* Alternative object name */</span> TCHAR altname[FF_SFN_BUF + 1]; <span class="c">/* Alternative object name */</span>
TCHAR fname[FF_LFN_BUF + 1]; <span class="c">/* Primary object name */</span> TCHAR fname[FF_LFN_BUF + 1]; <span class="c">/* Primary object name */</span>
@ -82,6 +82,6 @@
</dl> </dl>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -56,6 +56,6 @@ FSIZE_t f_size (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

42
documents/doc/sobjid.html Normal file
View File

@ -0,0 +1,42 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - FFOBJID</title>
</head>
<body>
<div class="para">
<h2>FFOBJID</h2>
<p>The <tt>FFOBJID</tt> structure is an object identifier that holds the common status of open objects. This structure is for only internal use and it does not appear on the API.</p>
<pre>
<span class="k">typedef</span> <span class="k">struct</span> {
FATFS* fs; <span class="c">/* Pointer to the volume holds this object */</span>
WORD id; <span class="c">/* Volume mount ID when this object was opened */</span>
BYTE attr; <span class="c">/* Object attribute */</span>
BYTE stat; <span class="c">/* Object chain status (exFAT: b1-0: =0:not contiguous, =2:contiguous, =3:fragmented in this session, b2:sub-directory stretched) */</span>
DWORD sclust; <span class="c">/* Object data cluster (0:no data or root directory) */</span>
FSIZE_t objsize; <span class="c">/* Object size (valid when sclust != 0) */</span>
<span class="k">#if</span> FF_FS_EXFAT
DWORD n_cont; <span class="c">/* Size of first fragment - 1 (valid when stat == 3) */</span>
DWORD n_frag; <span class="c">/* Size of last fragment needs to be written to FAT (valid when not zero) */</span>
DWORD c_scl; <span class="c">/* Cluster of directory holds this object (valid when sclust != 0) */</span>
DWORD c_size; <span class="c">/* Size of directory holds this object (b7-b0: allocation status, valid when c_scl != 0) */</span>
DWORD c_ofs; <span class="c">/* Offset of entry of this object in the directory */</span>
<span class="k">#endif</span>
<span class="k">#if</span> FF_FS_LOCK
UINT lockid; <span class="c">/* File lock ID origin from 1 (index of file semaphore table Files[]) */</span>
<span class="k">#endif</span>
} FFOBJID;
</pre>
</div>
<p class="foot"><a href="../index.html">Return</a></p>
</body>
</html>

View File

@ -107,6 +107,6 @@ FRESULT f_stat (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

31
documents/doc/sxcwds.html Normal file
View File

@ -0,0 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - FFXCWDS</title>
</head>
<body>
<div class="para">
<h2>FFXCWDS</h2>
<p>The <tt>FFXCWDS</tt> structure holds a current working directory path. It is defined and used only when <tt>FF_FS_EXFAT == 1 &amp;&amp; FF_FS_RPATH != 0</tt>. This structure is for only internal use and it does not appear on the API.</p>
<pre>
<span class="k">typedef struct</span> {
DWORD d_scl; <span class="c">/* Directory start cluster (0:root dir) */</span>
DWORD d_size; <span class="c">/* Size of directory (b7-b0: cluster chain status) (invalid if d_scl == 0) */</span>
DWORD nxt_ofs; <span class="c">/* Offset of entry of next dir in this directory (invalid if last link) */</span>
} FFXCWDL;
<span class="k">typedef struct</span> {
UINT depth; <span class="c">/* Current directory depth (0:root dir) */</span>
FFXCWDL tbl[FF_PATH_DEPTH + 1]; <span class="c">/* Directory chain of current directory path */</span>
} FFXCWDS;
</pre>
</div>
<p class="foot"><a href="../index.html">Return</a></p>
</body>
</html>

View File

@ -82,6 +82,6 @@ S - f_sync()
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -56,6 +56,6 @@ FSIZE_t f_tell (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -59,6 +59,6 @@ FRESULT f_truncate (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -67,6 +67,6 @@ If condition of the object to be removed is applicable to the following terms, t
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -95,6 +95,6 @@ FRESULT set_timestamp (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -74,6 +74,6 @@ FRESULT f_write (
</div> </div>
<p class="foot"><a href="../00index_e.html">Return</a></p> <p class="foot"><a href="../index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -4,9 +4,6 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="cache-control" content="no-cache">
<meta name="description" content="Open source FAT filesystem for embedded projects">
<link rel="start" title="Site Top" href="../../">
<link rel="up" title="Freewares" href="../../fsw_e.html">
<link rel="stylesheet" href="css_e.css" type="text/css" media="screen" title="ELM Default"> <link rel="stylesheet" href="css_e.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - Generic FAT Filesystem Module</title> <title>FatFs - Generic FAT Filesystem Module</title>
</head> </head>
@ -17,7 +14,7 @@
<div class="abst"> <div class="abst">
<img src="res/layers.png" class="rset" width="245" height="255" alt="layer"> <img src="res/layers.png" class="rset" width="245" height="255" alt="layer">
<p>FatFs is a generic FAT/exFAT filesystem module for small embedded systems. The FatFs module is written in compliance with ANSI C (C89) and completely separated from the disk control layer. Therefore it is independent of the platforms and storage devices. It can be incorporated into small microcontrollers with limited resource, such as 8051, PIC, AVR, ARM, Z80, RX and etc. Also Petit FatFs module for tiny microcontrollers is available <a href="https://elm-chan.org/fsw/ff/00index_p.html">here</a><span class="lnk">&#128279;</span>.</p> <p>FatFs is a generic FAT/exFAT filesystem module for small embedded systems. The FatFs module is written in compliance with ANSI C (C89) and completely separated from the disk control layer. Therefore it is independent of the platforms and storage devices. It can be incorporated into small microcontrollers with limited resource, such as 8051, PIC, AVR, ARM, Z80, RX and etc. Also Petit FatFs module for tiny microcontrollers is available <a href="https://elm-chan.org/fsw/ff/00index_p.html">here</a>.</p>
<h4>Features</h4> <h4>Features</h4>
<ul> <ul>
@ -130,7 +127,7 @@
<p>The FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for any purpose without any restriction under your responsibility. For further information, refer to the application note.</p> <p>The FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for any purpose without any restriction under your responsibility. For further information, refer to the application note.</p>
<ul> <ul>
<li><em>Getting Started: <a href="doc/appnote.html">FatFs Application Note</a></em></li> <li><em>Getting Started: <a href="doc/appnote.html">FatFs Application Note</a></em></li>
<li>Download: <a href="https://elm-chan.org/fsw/ff/archives.html">Latest Release and Archives</a><span class="lnk">&#128279;</span></li> <li>Downloads: <a href="https://elm-chan.org/fsw/ff/archives.html">Latest Releases</a><span class="lnk">&#128279;</span></li>
<li>Community: <a href="https://elm-chan.org/fsw/ff/bd/">FatFs User Forum</a><span class="lnk">&#128279;</span></li> <li>Community: <a href="https://elm-chan.org/fsw/ff/bd/">FatFs User Forum</a><span class="lnk">&#128279;</span></li>
<li><a href="https://msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx">FAT32 Specification by Microsoft</a><span class="lnk">&#128279;</span> (The authorized document on FAT filesystem)</li> <li><a href="https://msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx">FAT32 Specification by Microsoft</a><span class="lnk">&#128279;</span> (The authorized document on FAT filesystem)</li>
<li><a href="https://elm-chan.org/docs/fat_e.html">The basics of FAT filesystem</a><span class="lnk">&#128279;</span> (FatFs is written based on this documentation)</li> <li><a href="https://elm-chan.org/docs/fat_e.html">The basics of FAT filesystem</a><span class="lnk">&#128279;</span> (FatFs is written based on this documentation)</li>
@ -138,11 +135,11 @@
<li><a href="https://elm-chan.org/docs/mmc/mmc_e.html">How to use MMC/SDC</a><span class="lnk">&#128279;</span></li> <li><a href="https://elm-chan.org/docs/mmc/mmc_e.html">How to use MMC/SDC</a><span class="lnk">&#128279;</span></li>
<li><a href="https://elm-chan.org/junk/fa/faff.html">Playing with FlashAir and FatFs</a><span class="lnk">&#128279;</span></li> <li><a href="https://elm-chan.org/junk/fa/faff.html">Playing with FlashAir and FatFs</a><span class="lnk">&#128279;</span></li>
<li><a href="https://nemuisan.blog.bai.ne.jp/">Nemuisan's Blog</a><span class="lnk">&#128279;</span> (Well written implementations for STM32F/SPI &amp; SDIO and LPC4088/SDMMC)</li> <li><a href="https://nemuisan.blog.bai.ne.jp/">Nemuisan's Blog</a><span class="lnk">&#128279;</span> (Well written implementations for STM32F/SPI &amp; SDIO and LPC4088/SDMMC)</li>
<li><a href="https://stm32f4-discovery.net/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/">Read SD card with FatFs on STM32F4xx devices by Tilen Majerle</a><span class="lnk">&#128279;</span> (Quick and easy implementation for STM32F4-Discovery)</li> <li><a href="http://stm32f4-discovery.net/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/">Read SD card with FatFs on STM32F4xx devices by Tilen Majerle</a><span class="lnk">&#128279;</span> (Quick and easy implementation for STM32F4-Discovery)</li>
</div> </div>
<hr> <hr>
<p class="foot"><a href="http://elm-chan.org/fsw/ff/">Go to FatFs Home Page</a></p> <p class="foot"><a href="https://elm-chan.org/fsw/ff/">Home Page</a></p>
</body> </body>
</html> </html>

View File

@ -13,25 +13,44 @@
<tr><th>Revision</th><th>Updates</th><th>Migration Notes</th></tr> <tr><th>Revision</th><th>Updates</th><th>Migration Notes</th></tr>
<tr>
<td>R0.16<br>Jul 22, 2025</td>
<td>
<ul class="plain">
<li>Removed a long-pending limitation that <tt>f_getcwd</tt> and double-dot <tt>".."</tt> in the path name did not work on the exFAT volume.</li>
<li>Fixed <tt>f_readdir</tt> cannot detect end of directory and it leads the application process into infinite loop. (appeared at R0.15b)</li>
<li>Fixed dot names with terminating separator or duplicated separator are rejected when LFN is not enabled.</li>
</ul>
</td>
<td>
<ul class="plain">
<li>Maximum depth of sub-directory on the exFAT volume is limited to the configured level <tt>FF_PATH_DEPTH</tt> when relative path is enabled.</li>
</ul>
</td>
</tr>
<tr> <tr>
<td>R0.15b<br>Jun 21, 2025</td> <td>R0.15b<br>Jun 21, 2025</td>
<td> <td>
Added support for timestamp of created time. (<tt>FF_FS_CRTIME</tt>)<br> <ul class="plain">
Fixed FatFs fails to load the FsInfo in FAT32 volumes and the <tt>f_getfree</tt> always be forced a full FAT scan which takes a long time. (appeared at R0.15a)<br> <li>Added support for the timestamp of created time. (<tt>FF_FS_CRTIME</tt>)</li>
</td> <li>Fixed FatFs fails to load the FsInfo in FAT32 volumes and the <tt>f_getfree</tt> always be forced a full FAT scan which takes a long time. (appeared at R0.15a)</li>
</ul></td>
<td> <td>
Small changes to the <tt>f_utime</tt> function to support for the timestamp of created time.<br> <ul class="plain">
</td> <li>Small changes to the <tt>f_utime</tt> function to support for the timestamp of created time.</li>
</ul></td>
</tr> </tr>
<tr> <tr>
<td>R0.15a<br>Nov 22, 2024</td> <td>R0.15a<br>Nov 22, 2024</td>
<td> <td>
Fixed a complie error when <tt>FF_FS_LOCK != 0</tt>. (appeared at R0.15)</br> <ul class="plain">
Fixed a potential issue when work FatFs concurrency with <tt>FF_FS_REENTRANT</tt>, <tt>FF_VOLUMES &gt;= 2</tt> and <tt>FF_FS_LOCK &gt; 0</tt>.<br> <li>Fixed a complie error when <tt>FF_FS_LOCK != 0</tt>. (appeared at R0.15)</li>
Made <tt>f_setlabel</tt> accept a volume label with Unix style volume ID when <tt>FF_STR_VOLUME_ID == 2</tt>.<br> <li>Fixed a potential issue when work FatFs concurrency with <tt>FF_FS_REENTRANT</tt>, <tt>FF_VOLUMES &gt;= 2</tt> and <tt>FF_FS_LOCK &gt; 0</tt>.</li>
Made FatFs update <tt>PercInUse</tt> field in exFAT VBR. (A preceding <tt>f_getfree</tt> is needed for the accuracy)<br> <li>Made <tt>f_setlabel</tt> accept a volume label with Unix style volume ID when <tt>FF_STR_VOLUME_ID == 2</tt>.</li>
</td> <li>Made FatFs update <tt>PercInUse</tt> field in exFAT VBR. (A preceding <tt>f_getfree</tt> is needed for the accuracy)</li>
</ul></td>
<td> <td>
</td> </td>
</tr> </tr>
@ -39,506 +58,630 @@ Made FatFs update <tt>PercInUse</tt> field in exFAT VBR. (A preceding <tt>f_getf
<tr> <tr>
<td>R0.15<br>Nov 6, 2022</td> <td>R0.15<br>Nov 6, 2022</td>
<td> <td>
Changed user provided synchronization functions in order to completely eliminate the platform dependency from FatFs code.<br> <ul class="plain">
Fixed a potential error in <tt>f_mount</tt> when <tt>FF_FS_REENTRANT</tt>.<br> <li>Changed user provided synchronization functions in order to completely eliminate the platform dependency from FatFs code.</li>
Fixed file lock control <tt>FF_FS_LOCK</tt> is not mutal excluded when <tt>FF_FS_REENTRANT && FF_VOLUMES &gt; 1</tt> is true.<br> <li>Fixed a potential error in <tt>f_mount</tt> when <tt>FF_FS_REENTRANT</tt>.</li>
Fixed <tt>f_mkfs</tt> creates broken exFAT volume when the size of volume is <tt>&gt;= 2^32</tt> sectors.<br> <li>Fixed file lock control <tt>FF_FS_LOCK</tt> is not mutal excluded when <tt>FF_FS_REENTRANT &amp;&amp; FF_VOLUMES &gt; 1</tt> is true.</li>
Fixed string functions cannot write the unicode characters not in BMP when <tt>FF_LFN_UNICODE == 2</tt> (UTF-8).<br> <li>Fixed <tt>f_mkfs</tt> creates broken exFAT volume when the size of volume is <tt>&gt;= 2^32</tt> sectors.</li>
Fixed a compatibility issue in identification of GPT header.<br> <li>Fixed string functions cannot write the unicode characters not in BMP when <tt>FF_LFN_UNICODE == 2</tt> (UTF-8).</li>
</td> <li>Fixed a compatibility issue in identification of GPT header.</li>
</ul></td>
<td> <td>
User provided synchronization functions, <tt>ff_cre_syncobj</tt>, <tt>ff_del_syncobj</tt>, <tt>ff_req_grant</tt> and <tt>ff_rel_grant</tt>, needed when <tt>FF_FS_REENTRANT</tt> are replaced with <tt>ff_mutex_create</tt>, <tt>ff_mutex_delete</tt>, <tt>ff_mutex_take</tt> and <tt>ff_mutex_give</tt> respectively. For example, see <tt>ffsystem.c</tt>.<br> <ul class="plain">
<tt>FF_SYNC_t</tt> is removed from the configuration options.<br> <li>User provided synchronization functions, <tt>ff_cre_syncobj</tt>, <tt>ff_del_syncobj</tt>, <tt>ff_req_grant</tt> and <tt>ff_rel_grant</tt>, needed when <tt>FF_FS_REENTRANT</tt> are replaced with <tt>ff_mutex_create</tt>, <tt>ff_mutex_delete</tt>, <tt>ff_mutex_take</tt> and <tt>ff_mutex_give</tt> respectively. For example, see <tt>ffsystem.c</tt>.</li>
</td> <li><tt>FF_SYNC_t</tt> is removed from the configuration options.</li>
</ul></td>
</tr> </tr>
<tr> <tr>
<td>R0.14b<br>Apr 17, 2021</td> <td>R0.14b<br>Apr 17, 2021</td>
<td> <td>
Made FatFs uses standard library <tt>string.h</tt> for copy, compare and search instead of built-in string functions.<br> <ul class="plain">
Added support for long long integer and floating point to <tt>f_printf</tt>. (<tt>FF_STRF_LLI</tt> and <tt>FF_STRF_FP</tt>)<br> <li>Made FatFs uses standard library <tt>string.h</tt> for copy, compare and search instead of built-in string functions.</li>
Made path name parser ignores the terminating separator to allow <tt>"dir/"</tt>.<br> <li>Added support for long long integer and floating point to <tt>f_printf</tt>. (<tt>FF_STRF_LLI</tt> and <tt>FF_STRF_FP</tt>)</li>
Improved the compatibility in Unix style path name feature.<br> <li>Made path name parser ignores the terminating separator to allow <tt>"dir/"</tt>.</li>
Fixed the file gets dead-locked when <tt>f_open</tt> failed with certain conditions. (appeared at R0.12a)<br> <li>Improved the compatibility in Unix style path name feature.</li>
Fixed <tt>f_mkfs</tt> can create wrong exFAT volume due to a timing dependent error. (appeared at R0.12)<br> <li>Fixed the file gets dead-locked when <tt>f_open</tt> failed with certain conditions. (appeared at R0.12a)</li>
Fixed code page 855 cannot be set by <tt>f_setcp</tt>. (appeared at R0.13)<br> <li>Fixed <tt>f_mkfs</tt> can create wrong exFAT volume due to a timing dependent error. (appeared at R0.12)</li>
Fixed some compiler warnings.<br> <li>Fixed code page 855 cannot be set by <tt>f_setcp</tt>. (appeared at R0.13)</li>
<li>Fixed some compiler warnings.</li>
</ul>
</td> </td>
<td> <td>
From this revision, FatFs depends on <tt>string.h</tt>.<br> <ul class="plain">
<li>From this revision, FatFs depends on <tt>string.h</tt>.</li>
</ul>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.14a<br>Dec 05, 2020</td> <td>R0.14a<br>Dec 05, 2020</td>
<td> <td>
Limited number of recursive calls in <tt>f_findnext</tt> to prevent stack overflow.<br> <ul class="plain">
Fixed old floppy disks formatted with MS-DOS 2.x and 3.x cannot be mounted.<br> <li>Limited number of recursive calls in <tt>f_findnext</tt> to prevent stack overflow.</li>
Fixed some compiler warnings.<br> <li>Fixed old floppy disks formatted with MS-DOS 2.x and 3.x cannot be mounted.</li>
<li>Fixed some compiler warnings.</li>
</ul>
</td> </td>
<td> <td>
Number of wildcards in the matching pattern in <tt>f_findfirst</tt> is limited to 4.<br> <ul class="plain">
<li>Number of wildcards in the matching pattern in <tt>f_findfirst</tt> is limited to 4.</li>
</ul>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.14<br>Oct 14, 2019</td> <td>R0.14<br>Oct 14, 2019</td>
<td> <td>
Added support for 64-bit LBA and GUID partition table (<tt>FF_LBA64</tt>)<br> <ul class="plain">
Changed some API functions, <tt>f_mkfs</tt> and <tt>f_fdisk</tt>.<br> <li>Added support for 64-bit LBA and GUID partition table (<tt>FF_LBA64</tt>)</li>
Fixed <tt>f_open</tt> cannot find the file with file name in length of <tt>FF_MAX_LFN</tt> characters.<br> <li>Changed some API functions, <tt>f_mkfs</tt> and <tt>f_fdisk</tt>.</li>
Fixed <tt>f_readdir</tt> cannot retrieve long file names in length of <tt>FF_MAX_LFN - 1</tt> characters.<br> <li>Fixed <tt>f_open</tt> cannot find the file with file name in length of <tt>FF_MAX_LFN</tt> characters.</li>
Fixed <tt>f_readdir</tt> returns file names with wrong case conversion. (appeared at R0.12)<br> <li>Fixed <tt>f_readdir</tt> cannot retrieve long file names in length of <tt>FF_MAX_LFN - 1</tt> characters.</li>
Fixed <tt>f_mkfs</tt> can fail to create exFAT volume in the second partition. (appeared at R0.12)<br> <li>Fixed <tt>f_readdir</tt> returns file names with wrong case conversion. (appeared at R0.12)</li>
<li>Fixed <tt>f_mkfs</tt> can fail to create exFAT volume in the second partition. (appeared at R0.12)</li>
</ul>
</td> </td>
<td> <td>
Usage of <tt>f_mkfs</tt> and <tt>f_fdisk</tt> is changed and some features are added to these functions.<br> <ul class="plain">
<li>Usage of <tt>f_mkfs</tt> and <tt>f_fdisk</tt> is changed and some features are added to these functions.</li>
</ul>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.13c<br>Oct 14, 2018</td> <td>R0.13c<br>Oct 14, 2018</td>
<td> <td>
Supported <tt>stdint.h</tt> for C99 and later. (<tt>integer.h</tt> was included in <tt>ff.h</tt>)<br> <ul class="plain">
Fixed reading a directory gets infinite loop when the last directory entry is not empty. (appeared at R0.12)<br> <li>Supported <tt>stdint.h</tt> for C99 and later. (<tt>integer.h</tt> was included in <tt>ff.h</tt>)</li>
Fixed creating a sub-directory in the fragmented sub-directory on the exFAT volume collapses FAT chain of the parent directory. (appeared at R0.12)<br> <li>Fixed reading a directory gets infinite loop when the last directory entry is not empty. (appeared at R0.12)</li>
Fixed <tt>f_getcwd</tt> cause output buffer overrun when the buffer has a valid drive number. (appeared at R0.13b)<br> <li>Fixed creating a sub-directory in the fragmented sub-directory on the exFAT volume collapses FAT chain of the parent directory. (appeared at R0.12)</li>
<li>Fixed <tt>f_getcwd</tt> cause output buffer overrun when the buffer has a valid drive number. (appeared at R0.13b)</li>
</ul>
</td> </td>
<td> <td>
From this revision, FatFs depends on <tt>stdint.h</tt> in C99 or later.<br> <ul class="plain">
<tt>integer.h</tt> is removed.<br> <li>From this revision, FatFs depends on <tt>stdint.h</tt> in C99 or later.</li>
<li><tt>integer.h</tt> is removed.</li>
</ul>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.13b<br>Apr 07, 2018</td> <td>R0.13b<br>Apr 07, 2018</td>
<td> <td>
Added support for UTF-32 encoding on the API. (<tt>FF_LFN_UNICODE = 3</tt>)<br> <ul class="plain">
Added support for Unix style volume prefix. (<tt>FF_STR_VOLUME_ID = 2</tt>)<br> <li>Added support for UTF-32 encoding on the API. (<tt>FF_LFN_UNICODE = 3</tt>)</li>
Fixed accesing objects in the exFAT root directory beyond the cluster boundary can fail. (appeared at R0.12c)<br> <li>Added support for Unix style volume prefix. (<tt>FF_STR_VOLUME_ID = 2</tt>)</li>
Fixed <tt>f_setlabel</tt> does not reject some invalid characters. (appeared at R0.09b)<br> <li>Fixed accesing objects in the exFAT root directory beyond the cluster boundary can fail. (appeared at R0.12c)</li>
<li>Fixed <tt>f_setlabel</tt> does not reject some invalid characters. (appeared at R0.09b)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.13a<br>Oct 14, 2017</td> <td>R0.13a<br>Oct 14, 2017</td>
<td> <td>
Added support for UTF-8 encoding on the API. (<tt>FF_LFN_UNICODE = 2</tt>)<br> <ul class="plain">
Added options for file name output buffer. (<tt>FF_LFN_BUF, FF_SFN_BUF</tt>)<br> <li>Added support for UTF-8 encoding on the API. (<tt>FF_LFN_UNICODE = 2</tt>)</li>
Added dynamic memory allocation option for working buffer of <tt>f_mkfs</tt> and <tt>f_fdisk</tt>.<br> <li>Added options for file name output buffer. (<tt>FF_LFN_BUF, FF_SFN_BUF</tt>)</li>
Fixed <tt>f_fdisk</tt> and <tt>f_mkfs</tt> create the partition table with wrong CHS parameters. (appeared at R0.09)<br> <li>Added dynamic memory allocation option for working buffer of <tt>f_mkfs</tt> and <tt>f_fdisk</tt>.</li>
Fixed <tt>f_unlink</tt> can cause lost clusters at fragmented file on the exFAT volume. (appeared at R0.12c)<br> <li>Fixed <tt>f_fdisk</tt> and <tt>f_mkfs</tt> create the partition table with wrong CHS parameters. (appeared at R0.09)</li>
Fixed <tt>f_setlabel</tt> rejects some valid characters for exFAT volume. (appeared at R0.12)<br> <li>Fixed <tt>f_unlink</tt> can cause lost clusters at fragmented file on the exFAT volume. (appeared at R0.12c)</li>
<li>Fixed <tt>f_setlabel</tt> rejects some valid characters for exFAT volume. (appeared at R0.12)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.13<br>May 21, 2017</td> <td>R0.13<br>May 21, 2017</td>
<td> <td>
Prefix of configuration item names are changed from <tt>"_"</tt> to <tt>"FF_"</tt>.<br> <ul class="plain">
Added <tt>f_setcp</tt>, run-time code page configuration. (<tt>FF_CODE_PAGE = 0</tt>)<br> <li>Prefix of configuration item names are changed from <tt>"_"</tt> to <tt>"FF_"</tt>.</li>
Improved cluster allocation time on stretch a deep buried cluster chain.<br> <li>Added <tt>f_setcp</tt>, run-time code page configuration. (<tt>FF_CODE_PAGE = 0</tt>)</li>
Improved processing time of <tt>f_mkdir</tt> with large cluster size by using <tt>FF_USE_LFN = 3</tt>.<br> <li>Improved cluster allocation time on stretch a deep buried cluster chain.</li>
Improved exFAT <tt>NoFatChain</tt> flag of the fragmented file to be set after it is truncated and got contiguous.<br> <li>Improved processing time of <tt>f_mkdir</tt> with large cluster size by using <tt>FF_USE_LFN = 3</tt>.</li>
Fixed archive attribute is left not set when a file on the exFAT volume is renamed. (appeared at R0.12)<br> <li>Improved exFAT <tt>NoFatChain</tt> flag of the fragmented file to be set after it is truncated and got contiguous.</li>
Fixed exFAT FAT entry can be collapsed when write or lseek operation to the existing file is done. (appeared at R0.12c)<br> <li>Fixed archive attribute is left not set when a file on the exFAT volume is renamed. (appeared at R0.12)</li>
Fixed creating a file can fail when a new cluster allocation to the exFAT directory occures. (appeared at R0.12c)<br> <li>Fixed exFAT FAT entry can be collapsed when write or lseek operation to the existing file is done. (appeared at R0.12c)</li>
<li>Fixed creating a file can fail when a new cluster allocation to the exFAT directory occures. (appeared at R0.12c)</li>
</ul>
</td> </td>
<td> <td>
ASCII only configuration, <tt>FF_CODE_PAGE = 1</tt>, is removed. Use <tt>FF_CODE_PAGE = 437</tt> instead.<br> <ul class="plain">
<li>ASCII only configuration, <tt>FF_CODE_PAGE = 1</tt>, is removed. Use <tt>FF_CODE_PAGE = 437</tt> instead.</li>
</ul>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.12c<br>Mar 04, 2017</td> <td>R0.12c<br>Mar 04, 2017</td>
<td> <td>
Improved write throughput at the fragmented file on the exFAT volume.<br> <ul class="plain">
Made memory usage for exFAT be able to be reduced as decreasing <tt>_MAX_LFN</tt>.<br> <li>Improved write throughput at the fragmented file on the exFAT volume.</li>
Fixed successive <tt>f_getfree</tt> can return wrong count on the FAT12/16 volume. (appeared at R0.12)<br> <li>Made memory usage for exFAT be able to be reduced as decreasing <tt>_MAX_LFN</tt>.</li>
Fixed configuration option <tt>_VOLUMES</tt> cannot be set 10. (appeared at R0.10c)<br> <li>Fixed successive <tt>f_getfree</tt> can return wrong count on the FAT12/16 volume. (appeared at R0.12)</li>
<li>Fixed configuration option <tt>_VOLUMES</tt> cannot be set 10. (appeared at R0.10c)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.12b<br>Sep 4, 2016</td> <td>R0.12b<br>Sep 4, 2016</td>
<td> <td>
Made <tt>f_rename</tt> be able to rename objects with the same name but case.<br> <ul class="plain">
Fixed an error in the case conversion teble of code page 866. (<tt>ff.c</tt>)<br> <li>Made <tt>f_rename</tt> be able to rename objects with the same name but case.</li>
Fixed writing data is truncated at the file offset 4GiB on the exFAT volume. (appeared at R0.12)<br> <li>Fixed an error in the case conversion teble of code page 866. (<tt>ff.c</tt>)</li>
Fixed creating a file in the root directory of exFAT volume can fail. (appeared at R0.12)<br> <li>Fixed writing data is truncated at the file offset 4GiB on the exFAT volume. (appeared at R0.12)</<li>
Fixed <tt>f_mkfs</tt> creating exFAT volume with too small cluster size can collapse unallocated memory. (appeared at R0.12a)<br> <li>Fixed creating a file in the root directory of exFAT volume can fail. (appeared at R0.12)</li>
Fixed wrong object name can be returned when read directory at Unicode cfg. (appeared at R0.12)<br> <li>Fixed <tt>f_mkfs</tt> creating exFAT volume with too small cluster size can collapse unallocated memory. (appeared at R0.12a)</li>
Fixed large file allocation/removing on the exFAT volume collapses allocation bitmap. (appeared at R0.12)<br> <li>Fixed wrong object name can be returned when read directory at Unicode cfg. (appeared at R0.12)</li>
Fixed some internal errors in <tt>f_expand</tt> and <tt>f_lseek.</tt> (appeared at R0.12)<br> <li>Fixed large file allocation/removing on the exFAT volume collapses allocation bitmap. (appeared at R0.12)</li>
<li>Fixed some internal errors in <tt>f_expand</tt> and <tt>f_lseek.</tt> (appeared at R0.12)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.12a<br>Jul 10, 2016</td> <td>R0.12a<br>Jul 10, 2016</td>
<td> <td>
Added support for creating exFAT volume with some changes of <tt>f_mkfs</tt>.<br> <ul class="plain">
Added a file open method <tt>FA_OPEN_APPEND</tt>.<br> <li>Added support for creating exFAT volume with some changes of <tt>f_mkfs</tt>.</li>
<tt>f_forward</tt> is available regardless of <tt>_FS_TINY</tt>.<br> <li>Added a file open method <tt>FA_OPEN_APPEND</tt>.</li>
Fixed <tt>f_mkfs</tt> creates broken volume. (appeared at R0.12)<br> <li><tt>f_forward</tt> is available regardless of <tt>_FS_TINY</tt>.</li>
Fixed wrong memory read in <tt>create_name</tt>. (appeared at R0.12)<br> <li>Fixed <tt>f_mkfs</tt> creates broken volume. (appeared at R0.12)</li>
Fixed compilation fails at some configurations, <tt>_USE_FASTSEEK</tt> and <tt>_USE_FORWARD</tt>.<br> <li>Fixed wrong memory read in <tt>create_name</tt>. (appeared at R0.12)</li>
<li>Fixed compilation fails at some configurations, <tt>_USE_FASTSEEK</tt> and <tt>_USE_FORWARD</tt>.</li>
</ul>
</td> </td>
<td> <td>
Usage of <tt>f_mkfs</tt> is changed.<br> <ul class="plain">
<li>Usage of <tt>f_mkfs</tt> is changed.</li>
</ul>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.12<br>Apr 12, 2016</td> <td>R0.12<br>Apr 12, 2016</td>
<td> <td>
Added support for exFAT file system. (<tt>_FS_EXFAT</tt>)<br> <ul class="plain">
Added <tt>f_expand</tt>. (<tt>_USE_EXPAND</tt>)<br> <li>Added support for exFAT file system. (<tt>_FS_EXFAT</tt>)</li>
Changed some members in <tt>FINFO</tt> and behavior of <tt>f_readdir</tt>.<br> <li>Added <tt>f_expand</tt>. (<tt>_USE_EXPAND</tt>)</li>
Added a configuration option <tt>_USE_CHMOD</tt>.<br> <li>Changed some members in <tt>FINFO</tt> and behavior of <tt>f_readdir</tt>.</li>
Fixed errors in the case conversion teble of Unicode (<tt>cc*.c</tt>).<br> <li>Added a configuration option <tt>_USE_CHMOD</tt>.</li>
<li>Fixed errors in the case conversion teble of Unicode (<tt>cc*.c</tt>).</li>
</ul>
</td> </td>
<td> <td>
Usage and members of <tt>FINFO</tt> sructure used in <tt>f_readdir</tt> is changed.<br> <ul class="plain">
Dot entries in the sub-directory are never appear in <tt>f_readdir</tt>.<br> <li>Usage and members of <tt>FINFO</tt> sructure used in <tt>f_readdir</tt> is changed.</li>
<tt>".."</tt> does not work as path name in exFAT volume.<br> <li>Dot entries in the sub-directory are never appear in <tt>f_readdir</tt>.</li>
<tt>f_getcwd</tt> does not work in exFAT volume.</br> <li><tt>".."</tt> does not work as path name in exFAT volume.</li>
Many members in <tt>FIL</tt> and <tt>DIR</tt> structure are changed.<br> <li><tt>f_getcwd</tt> does not work in exFAT volume.</li>
To use <tt>f_chmod</tt>, <tt>_USE_CHMOD</tt> needs to be set.<br> <li>Many members in <tt>FIL</tt> and <tt>DIR</tt> structure are changed.</li>
<tt>_WORD_ACCESS</tt> is removed from the configuration options.<br> <li>To use <tt>f_chmod</tt>, <tt>_USE_CHMOD</tt> needs to be set.</li>
<li><tt>_WORD_ACCESS</tt> is removed from the configuration options.</li>
</ul>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.11a<br>Sep 5, 2015</td> <td>R0.11a<br>Sep 5, 2015</td>
<td> <td>
Fixed wrong media change can lead a deadlock at thread-safe configuration.<br> <ul class="plain">
Added code page 771, 860, 861, 863, 864, 865 and 869. (<tt>_CODE_PAGE</tt>)<br> <li>Fixed wrong media change can lead a deadlock at thread-safe configuration.</li>
Fixed errors in the case conversion teble of code page 437 and 850 (<tt>ff.c</tt>).<br> <li>Added code page 771, 860, 861, 863, 864, 865 and 869. (<tt>_CODE_PAGE</tt>)</li>
Fixed errors in the case conversion teble of Unicode (<tt>cc*.c</tt>).<br> <li>Fixed errors in the case conversion teble of code page 437 and 850 (<tt>ff.c</tt>).</li>
<li>Fixed errors in the case conversion teble of Unicode (<tt>cc*.c</tt>).</li>
</ul>
</td> </td>
<td> <td>
Removed some code pages actually not exist on the standard systems. (<tt>_CODE_PAGE</tt>)<br> <ul class="plain">
<li>Removed some code pages actually not exist on the standard systems. (<tt>_CODE_PAGE</tt>)</li>
</ul>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.11<br>Feb 9, 2015</td> <td>R0.11<br>Feb 9, 2015</td>
<td> <td>
Added <tt>f_findfirst</tt> and <tt>f_findnext.</tt> (<tt>_USE_FIND</tt>)<br> <ul class="plain">
Fixed <tt>f_unlink</tt> does not remove cluster chain of the file. (appeared at R0.10c)<br> <li>Added <tt>f_findfirst</tt> and <tt>f_findnext.</tt> (<tt>_USE_FIND</tt>)</li>
Fixed <tt>_FS_NORTC</tt> option does not work properly. (appeared at R0.10c)<br> <li>Fixed <tt>f_unlink</tt> does not remove cluster chain of the file. (appeared at R0.10c)</li>
<li>Fixed <tt>_FS_NORTC</tt> option does not work properly. (appeared at R0.10c)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.10c<br>Nov 9, 2014</td> <td>R0.10c<br>Nov 9, 2014</td>
<td> <td>
Added a configuration option for the platforms without RTC. (<tt>_FS_NORTC</tt>)<br> <ul class="plain">
Fixed volume label created by Mac OS X cannot be retrieved with <tt>f_getlabel</tt>. (appeared at R0.09b)<br> <li>Added a configuration option for the platforms without RTC. (<tt>_FS_NORTC</tt>)</li>
Fixed a potential problem of FAT access that can appear on disk error.<br> <li>Fixed volume label created by Mac OS X cannot be retrieved with <tt>f_getlabel</tt>. (appeared at R0.09b)</li>
Fixed null pointer dereference on attempting to delete the root direcotry. (appeared at R0.08)<br> <li>Fixed a potential problem of FAT access that can appear on disk error.</li>
<li>Fixed null pointer dereference on attempting to delete the root direcotry. (appeared at R0.08)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.10b<br>May 19, 2014</td> <td>R0.10b<br>May 19, 2014</td>
<td> <td>
Fixed a hard error in the disk I/O layer can collapse the directory entry.<br> <ul class="plain">
Fixed LFN entry is not deleted on delete/rename an object with its lossy converted SFN. (appeared at R0.07)<br> <li>Fixed a hard error in the disk I/O layer can collapse the directory entry.</li>
<li>Fixed LFN entry is not deleted on delete/rename an object with its lossy converted SFN. (appeared at R0.07)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.10a<br>Jan 15, 2014</td> <td>R0.10a<br>Jan 15, 2014</td>
<td> <td>
Added arbitrary strings as drive number in the path name. (<tt>_STR_VOLUME_ID</tt>)<br> <ul class="plain">
Added an option for minimum sector size. (<tt>_MIN_SS</tt>)<br> <li>Added arbitrary strings as drive number in the path name. (<tt>_STR_VOLUME_ID</tt>)</li>
2nd argument of <tt>f_rename</tt> can have a drive number and it will be ignored.<br> <li>Added an option for minimum sector size. (<tt>_MIN_SS</tt>)</li>
Fixed <tt>f_mount</tt> with forced mount fails when drive number is larger than 0. (appeared at R0.10)<br> <li>2nd argument of <tt>f_rename</tt> can have a drive number and it will be ignored.</li>
Fixed <tt>f_close</tt> invalidates the file object without volume lock.<br> <li>Fixed <tt>f_mount</tt> with forced mount fails when drive number is larger than 0. (appeared at R0.10)</li>
Fixed volume lock is left acquired after return from <tt>f_closedir</tt>. (appeared at R0.10)<br> <li>Fixed <tt>f_close</tt> invalidates the file object without volume lock.</li>
Fixed creation of a directory entry with LFN fails on too many SFN collisions. (appeared at R0.07)<br> <li>Fixed volume lock is left acquired after return from <tt>f_closedir</tt>. (appeared at R0.10)</li>
<li>Fixed creation of a directory entry with LFN fails on too many SFN collisions. (appeared at R0.07)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.10<br>Oct 2, 2013</td> <td>R0.10<br>Oct 2, 2013</td>
<td> <td>
Added an option for character encoding on the file. (<tt>_STRF_ENCODE</tt>)<br> <ul class="plain">
Added f_closedir.<br> <li>Added an option for character encoding on the file. (<tt>_STRF_ENCODE</tt>)</li>
Added forced full FAT scan option for <tt>f_getfree</tt>. (<tt>_FS_NOFSINFO</tt>)<br> <li>Added f_closedir.</li>
Added forced mount option with changes of <tt>f_mount</tt>.<br> <li>Added forced full FAT scan option for <tt>f_getfree</tt>. (<tt>_FS_NOFSINFO</tt>)</li>
Improved behavior of volume auto detection.<br> <li>Added forced mount option with changes of <tt>f_mount</tt>.</li>
Improved write throughput of <tt>f_puts</tt> and <tt>f_printf</tt>.<br> <li>Improved behavior of volume auto detection.</li>
Changed argument of <tt>f_chdrive,</tt> <tt>f_mkfs</tt>, <tt>disk_read</tt> and <tt>disk_write</tt>.<br> <li>Improved write throughput of <tt>f_puts</tt> and <tt>f_printf</tt>.</li>
Fixed <tt>f_write</tt> can be truncated when the file size is close to 4 GB.<br> <li>Changed argument of <tt>f_chdrive,</tt> <tt>f_mkfs</tt>, <tt>disk_read</tt> and <tt>disk_write</tt>.</li>
Fixed <tt>f_open</tt>, <tt>f_mkdir</tt> and <tt>f_setlabel</tt> can return incorrect result code on error.<br> <li>Fixed <tt>f_write</tt> can be truncated when the file size is close to 4 GB.</li>
<li>Fixed <tt>f_open</tt>, <tt>f_mkdir</tt> and <tt>f_setlabel</tt> can return incorrect result code on error.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.09b<br>Jan 24, 2013</td> <td>R0.09b<br>Jan 24, 2013</td>
<td> <td>
Added <tt>f_getlabel</tt> and <tt>f_setlabel</tt>. (<tt>_USE_LABEL</tt>)<br> <ul class="plain">
<li>Added <tt>f_getlabel</tt> and <tt>f_setlabel</tt>. (<tt>_USE_LABEL</tt>)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.09a<br>Aug 27, 2012</td> <td>R0.09a<br>Aug 27, 2012</td>
<td> <td>
Fixed assertion failure due to OS/2 EA on FAT12/16 volume.<br> <ul class="plain">
Changed file functions reject null object pointer to avoid crash.<br> <li>Fixed assertion failure due to OS/2 EA on FAT12/16 volume.</li>
Changed option name <tt>_FS_SHARE</tt> to <tt>_FS_LOCK</tt>.<br> <li>Changed file functions reject null object pointer to avoid crash.</li>
<li>Changed option name <tt>_FS_SHARE</tt> to <tt>_FS_LOCK</tt>.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.09<br>Sep 6, 2011</td> <td>R0.09<br>Sep 6, 2011</td>
<td> <td>
<tt>f_mkfs</tt> supports multiple partition on a physical drive.<br> <ul class="plain">
Added <tt>f_fdisk</tt>. (<tt>_MULTI_PARTITION = 2</tt>)<br> <li><tt>f_mkfs</tt> supports multiple partition on a physical drive.</li>
<li>Added <tt>f_fdisk</tt>. (<tt>_MULTI_PARTITION = 2</tt>)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.08b<br>Jan 15, 2011</td> <td>R0.08b<br>Jan 15, 2011</td>
<td> <td>
Fast seek function is also applied to <tt>f_read</tt> and <tt>f_write</tt>.<br> <ul class="plain">
<tt>f_lseek</tt> reports required table size on creating CLMP.<br> <li>Fast seek function is also applied to <tt>f_read</tt> and <tt>f_write</tt>.</li>
Extended format syntax of <tt>f_printf</tt>.<br> <li><tt>f_lseek</tt> reports required table size on creating CLMP.</li>
Ignores duplicated directory separators in given path names.<br> <li>Extended format syntax of <tt>f_printf</tt>.</li>
<li>Ignores duplicated directory separators in given path names.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.08a<br>Aug 16, 2010</td> <td>R0.08a<br>Aug 16, 2010</td>
<td> <td>
Added <tt>f_getcwd</tt>. (<tt>_FS_RPATH = 2</tt>)<br> <ul class="plain">
Added sector erase function. (<tt>_USE_ERASE</tt>)<br> <li>Added <tt>f_getcwd</tt>. (<tt>_FS_RPATH = 2</tt>)</li>
Moved file lock semaphore table from fs object to the bss.<br> <li>Added sector erase function. (<tt>_USE_ERASE</tt>)</li>
Fixed <tt>f_mkdir</tt> creates wrong directory on non-LFN cfg when the given name contains <tt>';'</tt>.<br> <li>Moved file lock semaphore table from fs object to the bss.</li>
Fixed <tt>f_mkfs</tt> creates wrong FAT32 volume.<br> <li>Fixed <tt>f_mkdir</tt> creates wrong directory on non-LFN cfg when the given name contains <tt>';'</tt>.</li>
<li>Fixed <tt>f_mkfs</tt> creates wrong FAT32 volume.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.08<br>May 15, 2010</td> <td>R0.08<br>May 15, 2010</td>
<td> <td>
Added an option to <tt>_USE_LFN</tt><br> <ul class="plain">
Added support of file lock. (<tt>_FS_SHARE</tt>)<br> <li>Added an option to <tt>_USE_LFN</tt></li>
Added fast seek function. (<tt>_USE_FASTSEEK</tt>)<br> <li>Added support of file lock. (<tt>_FS_SHARE</tt>)</li>
Changed a type name on the API, <tt>XCHAR</tt> to <tt>TCHAR</tt>.<br> <li>Added fast seek function. (<tt>_USE_FASTSEEK</tt>)</li>
Changed member, <tt>fname</tt>, in the <tt>FILINFO</tt> on Unicode cfg.<br> <li>Changed a type name on the API, <tt>XCHAR</tt> to <tt>TCHAR</tt>.</li>
String functions support UTF-8 encoding files on Unicode cfg.<br> <li>Changed member, <tt>fname</tt>, in the <tt>FILINFO</tt> on Unicode cfg.</li>
<li>String functions support UTF-8 encoding files on Unicode cfg.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.07e<br>Nov 3, 2009</td> <td>R0.07e<br>Nov 3, 2009</td>
<td> <td>
Separated out configuration options from <tt>ff.h</tt> to <tt>ffconf.h</tt>.<br> <ul class="plain">
Added a configuration option, <tt>_LFN_UNICODE</tt>.<br> <li>Separated out configuration options from <tt>ff.h</tt> to <tt>ffconf.h</tt>.</li>
Fixed <tt>f_unlink</tt> fails to remove a sub-dir on <tt>_FS_RPATH</tt>.<br> <li>Added a configuration option, <tt>_LFN_UNICODE</tt>.</li>
Fixed name matching error on the 13 char boundary.<br> <li>Fixed <tt>f_unlink</tt> fails to remove a sub-dir on <tt>_FS_RPATH</tt>.</li>
Changed <tt>f_readdir</tt> to return the SFN with always upper case on non-LFN cfg.<br> <li>Fixed name matching error on the 13 char boundary.</li>
<li>Changed <tt>f_readdir</tt> to return the SFN with always upper case on non-LFN cfg.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.07c<br>Jan 21, 2009</td> <td>R0.07c<br>Jan 21, 2009</td>
<td> <td>
Fixed <tt>f_unlink</tt> may return FR_OK on error.<br> <ul class="plain">
Fixed wrong cache control in <tt>f_lseek</tt>.<br> <li>Fixed <tt>f_unlink</tt> may return FR_OK on error.</li>
Added support of relative path.<br> <li>Fixed wrong cache control in <tt>f_lseek</tt>.</li>
Added <tt>f_chdir</tt>.<br> <li>Added support of relative path.</li>
Added <tt>f_chdrive</tt>.<br> <li>Added <tt>f_chdir</tt>.</li>
Added proper case conversion to extended characters.<br> <li>Added <tt>f_chdrive</tt>.</li>
<li>Added proper case conversion to extended characters.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.07a<br>Apr 14, 2009</td> <td>R0.07a<br>Apr 14, 2009</td>
<td> <td>
Separated out OS dependent code on re-entrant configuration.<br> <ul class="plain">
Added multiple sector size support.<br> <li>Separated out OS dependent code on re-entrant configuration.</li>
<li>Added multiple sector size support.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.07<br>Apr 1, 2009</td> <td>R0.07<br>Apr 1, 2009</td>
<td> <td>
Merged Tiny-FatFs into FatFs as a buffer configuration option.<br> <ul class="plain">
Added support for long file extension.<br> <li>Merged Tiny-FatFs into FatFs as a buffer configuration option.</li>
Added multiple code page support.<br> <li>Added support for long file extension.</li>
Added re-entrancy for multitask operation.<br> <li>Added multiple code page support.</li>
Added auto cluster size selection to <tt>f_mkfs</tt>.<br> <li>Added re-entrancy for multitask operation.</li>
Added rewind option to <tt>f_readdir</tt>.<br> <li>Added auto cluster size selection to <tt>f_mkfs</tt>.</li>
Changed result code of critical errors.<br> <li>Added rewind option to <tt>f_readdir</tt>.</li>
Renamed string functions to avoid name collision.<br> <li>Changed result code of critical errors.</li>
<li>Renamed string functions to avoid name collision.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.06<br>Apr 1, 2008</td> <td>R0.06<br>Apr 1, 2008</td>
<td> <td>
Added <tt>f_forward</tt>. (Tiny-FatFs)<br> <ul class="plain">
Added string functions: <tt>f_gets</tt>, <tt>f_putc</tt>, <tt>f_puts</tt> and <tt>f_printf</tt>.<br> <li>Added <tt>f_forward</tt>. (Tiny-FatFs)</li>
Improved performance of <tt>f_lseek</tt> on moving to the same or following cluster.<br> <li>Added string functions: <tt>f_gets</tt>, <tt>f_putc</tt>, <tt>f_puts</tt> and <tt>f_printf</tt>.</li>
<li>Improved performance of <tt>f_lseek</tt> on moving to the same or following cluster.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.05a<br>Feb 3, 2008</td> <td>R0.05a<br>Feb 3, 2008</td>
<td> <td>
Added <tt>f_truncate</tt>.<br> <ul class="plain">
Added <tt>f_utime</tt>.<br> <li>Added <tt>f_truncate</tt>.</li>
Fixed off by one error at FAT sub-type determination.<br> <li>Added <tt>f_utime</tt>.</li>
Fixed btr in <tt>f_read</tt> can be mistruncated.<br> <li>Fixed off by one error at FAT sub-type determination.</li>
Fixed cached sector is left not flushed when create and close without write.<br> <li>Fixed btr in <tt>f_read</tt> can be mistruncated.</li>
<li>Fixed cached sector is left not flushed when create and close without write.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.05<br>Aug 26, 2007</td> <td>R0.05<br>Aug 26, 2007</td>
<td> <td>
Changed arguments of <tt>f_read</tt>, <tt>f_write</tt>.<br> <ul class="plain">
Changed arguments of <tt>f_mkfs</tt>. (FatFs)<br> <li>Changed arguments of <tt>f_read</tt>, <tt>f_write</tt>.</li>
Fixed <tt>f_mkfs</tt> on FAT32 creates incorrect FSInfo. (FatFs)<br> <li>Changed arguments of <tt>f_mkfs</tt>. (FatFs)</li>
Fixed <tt>f_mkdir</tt> on FAT32 creates broken directory. (FatFs)<br> <li>Fixed <tt>f_mkfs</tt> on FAT32 creates incorrect FSInfo. (FatFs)</li>
<li>Fixed <tt>f_mkdir</tt> on FAT32 creates broken directory. (FatFs)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.04b<br>May 5, 2007</td> <td>R0.04b<br>May 5, 2007</td>
<td> <td>
Added <tt>_USE_NTFLAG</tt> option.<br> <ul class="plain">
Added support for FSInfo in FAT32 volume.<br> <li>Added <tt>_USE_NTFLAG</tt> option.</li>
Fixed some problems corresponds to FAT32. (Tiny-FatFs)<br> <li>Added support for FSInfo in FAT32 volume.</li>
Fixed DBCS name can result <tt>FR_INVALID_NAME</tt>.<br> <li>Fixed some problems corresponds to FAT32. (Tiny-FatFs)</li>
Fixed short seek (<tt>&lt;= csize</tt>) collapses the file object.<br> <li>Fixed DBCS name can result <tt>FR_INVALID_NAME</tt>.</li>
<li>Fixed short seek (<tt>&lt;= csize</tt>) collapses the file object.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.04a<br>Apr 1, 2007</td> <td>R0.04a<br>Apr 1, 2007</td>
<td> <td>
Supported multiple partitions on a plysical drive. (FatFs)<br> <ul class="plain">
Added minimization level 3.<br> <li>Supported multiple partitions on a plysical drive. (FatFs)</li>
Added a capability of extending file size to <tt>f_lseek</tt>.<br> <li>Added minimization level 3.</li>
Fixed an endian sensitive code in <tt>f_mkfs</tt>. (FatFs)<br> <li>Added a capability of extending file size to <tt>f_lseek</tt>.</li>
Fixed a problem corresponds to FAT32 support. (Tiny-FatFs)<br> <li>Fixed an endian sensitive code in <tt>f_mkfs</tt>. (FatFs)</li>
<li>Fixed a problem corresponds to FAT32 support. (Tiny-FatFs)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.04<br>Feb 4, 2007</td> <td>R0.04<br>Feb 4, 2007</td>
<td> <td>
Supported multiple drive system. (FatFs)<br> <ul class="plain">
Changed some APIs for multiple drive system.<br> <li>Supported multiple drive system. (FatFs)</li>
Added <tt>f_mkfs</tt>. (FatFs)<br> <li>Changed some APIs for multiple drive system.</li>
Added <tt>_USE_FAT32</tt> option. (Tiny-FatFs)<br> <li>Added <tt>f_mkfs</tt>. (FatFs)</li>
<li>Added <tt>_USE_FAT32</tt> option. (Tiny-FatFs)</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.03a<br>Dec 11, 2006</td> <td>R0.03a<br>Dec 11, 2006</td>
<td> <td>
Improved cluster scan algolithm to write files fast.<br> <ul class="plain">
Fixed <tt>f_mkdir</tt> creates broken directory on FAT32.<br> <li>Improved cluster scan algolithm to write files fast.</li>
<li>Fixed <tt>f_mkdir</tt> creates broken directory on FAT32.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.03<br>Sep 22, 2006</td> <td>R0.03<br>Sep 22, 2006</td>
<td> <td>
Added <tt>f_rename</tt>. <ul class="plain">
Changed option <tt>_FS_MINIMUM</tt> to <tt>_FS_MINIMIZE</tt>.<br> <li>Added <tt>f_rename</tt>.
<li>Changed option <tt>_FS_MINIMUM</tt> to <tt>_FS_MINIMIZE</tt>.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.02a<br>Jun 10, 2006</td> <td>R0.02a<br>Jun 10, 2006</td>
<td> <td>
Added a configuration option <tt>_FS_MINIMUM</tt>.<br> <ul class="plain">
<li>Added a configuration option <tt>_FS_MINIMUM</tt>.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.02<br>Jun 01, 2006</td> <td>R0.02<br>Jun 01, 2006</td>
<td> <td>
Added FAT12.<br> <ul class="plain">
Removed unbuffered mode.<br> <li>Added FAT12.</li>
Fixed a problem on small (<tt>&lt;32M</tt>) patition.<br> <li>Removed unbuffered mode.</li>
<li>Fixed a problem on small (<tt>&lt;32M</tt>) patition.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>R0.01<br>Apr 29, 2006</td> <td>R0.01<br>Apr 29, 2006</td>
<td> <td>
First release.<br> <ul class="plain">
<li>First release.</li>
</ul>
</td> </td>
<td> <td>
</td> </td>
</tr> </tr>
</table> </table>
<p class="foot"><a href=".">Return</a></p> <p class="foot"><a href="index.html">Return</a></p>
</body> </body>
</html> </html>

View File

@ -381,3 +381,9 @@ R0.15b (June 21, 2025)
Added support for timestamp of created time. (FF_FS_CRTIME) Added support for timestamp of created time. (FF_FS_CRTIME)
Fixed FatFs fails to load the FsInfo in FAT32 volumes and the f_getfree always be forced a full FAT scan which takes a long time. (appeared at R0.15a) Fixed FatFs fails to load the FsInfo in FAT32 volumes and the f_getfree always be forced a full FAT scan which takes a long time. (appeared at R0.15a)
R0.16 (July 22, 2025)
Removed a long-pending limitation that f_getcwd and double-dot .. in the path name did not work on the exFAT volume.
Fixed f_readdir cannot detect end of directory and it leads the application process into infinite loop. (appeared at R0.15b)
Fixed dot names with terminating separator or duplicated separator are rejected when LFN is not enabled.

View File

@ -1,4 +1,4 @@
FatFs Module Source Files R0.15 FatFs Module Source Files R0.16
FILES FILES

View File

@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
/* Low level disk I/O module SKELETON for FatFs (C)ChaN, 2019 */ /* Low level disk I/O module SKELETON for FatFs (C)ChaN, 2025 */
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
/* If a working storage control module is available, it should be */ /* If a working storage control module is available, it should be */
/* attached to the FatFs via a glue function rather than modifying it. */ /* attached to the FatFs via a glue function rather than modifying it. */
@ -7,13 +7,17 @@
/* storage control modules to the FatFs module with a defined API. */ /* storage control modules to the FatFs module with a defined API. */
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
#include "ff.h" /* Obtains integer types */ #include "ff.h" /* Basic definitions of FatFs */
#include "diskio.h" /* Declarations of disk functions */ #include "diskio.h" /* Declarations FatFs MAI */
/* Definitions of physical drive number for each drive */ /* Example: Declarations of the platform and disk functions in the project */
#define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */ #include "platform.h"
#define DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */ #include "storage.h"
#define DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */
/* Example: Mapping of physical drive number for each drive */
#define DEV_FLASH 0 /* Map FTL to physical drive 0 */
#define DEV_MMC 1 /* Map MMC/SD card to physical drive 1 */
#define DEV_USB 2 /* Map USB MSD to physical drive 2 */
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/

View File

@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------/ /*-----------------------------------------------------------------------/
/ Low level disk interface modlue include file (C)ChaN, 2019 / / Low level disk interface modlue include file (C)ChaN, 2025 /
/-----------------------------------------------------------------------*/ /-----------------------------------------------------------------------*/
#ifndef _DISKIO_DEFINED #ifndef _DISKIO_DEFINED
@ -55,7 +55,7 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
#define CTRL_EJECT 7 /* Eject media */ #define CTRL_EJECT 7 /* Eject media */
#define CTRL_FORMAT 8 /* Create physical format on the media */ #define CTRL_FORMAT 8 /* Create physical format on the media */
/* MMC/SDC specific ioctl command */ /* MMC/SDC specific ioctl command (Not used by FatFs) */
#define MMC_GET_TYPE 10 /* Get card type */ #define MMC_GET_TYPE 10 /* Get card type */
#define MMC_GET_CSD 11 /* Get CSD */ #define MMC_GET_CSD 11 /* Get CSD */
#define MMC_GET_CID 12 /* Get CID */ #define MMC_GET_CID 12 /* Get CID */
@ -65,7 +65,7 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
#define ISDIO_WRITE 56 /* Write data to SD iSDIO register */ #define ISDIO_WRITE 56 /* Write data to SD iSDIO register */
#define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */ #define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */
/* ATA/CF specific ioctl command */ /* ATA/CF specific ioctl command (Not used by FatFs) */
#define ATA_GET_REV 20 /* Get F/W revision */ #define ATA_GET_REV 20 /* Get F/W revision */
#define ATA_GET_MODEL 21 /* Get model name */ #define ATA_GET_MODEL 21 /* Get model name */
#define ATA_GET_SN 22 /* Get serial number */ #define ATA_GET_SN 22 /* Get serial number */

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------/ /*----------------------------------------------------------------------------/
/ FatFs - Generic FAT Filesystem module R0.15b / / FatFs - Generic FAT Filesystem module R0.16 /
/-----------------------------------------------------------------------------/ /-----------------------------------------------------------------------------/
/ /
/ Copyright (C) 2025, ChaN, all right reserved. / Copyright (C) 2025, ChaN, all right reserved.
@ -20,7 +20,7 @@
#ifndef FF_DEFINED #ifndef FF_DEFINED
#define FF_DEFINED 5385 /* Revision ID */ #define FF_DEFINED 80386 /* Revision ID */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -127,47 +127,65 @@ extern const char* VolumeStr[FF_VOLUMES]; /* User defined volume ID table */
#endif #endif
/* Current working directory structure (FFXCWDS) */
#if FF_FS_EXFAT && FF_FS_RPATH
#if FF_PATH_DEPTH < 1
#error FF_PATH_DEPTH must not be zero
#endif
typedef struct {
DWORD d_scl; /* Directory start cluster (0:root dir) */
DWORD d_size; /* Size of directory (b7-b0: cluster chain status) (invalid if d_scl == 0) */
DWORD nxt_ofs; /* Offset of entry of next dir in this directory (invalid if last link) */
} FFXCWDL;
typedef struct {
UINT depth; /* Current directory depth (0:root dir) */
FFXCWDL tbl[FF_PATH_DEPTH + 1]; /* Directory chain of current working directory path */
} FFXCWDS;
#endif
/* Filesystem object structure (FATFS) */ /* Filesystem object structure (FATFS) */
typedef struct { typedef struct {
BYTE fs_type; /* Filesystem type (0:not mounted) */ BYTE fs_type; /* Filesystem type (0:not mounted) */
BYTE pdrv; /* Volume hosting physical drive */ BYTE pdrv; /* Physical drive that holds this volume */
BYTE ldrv; /* Logical drive number (used only when FF_FS_REENTRANT) */ BYTE ldrv; /* Logical drive number (used only when FF_FS_REENTRANT) */
BYTE n_fats; /* Number of FATs (1 or 2) */ BYTE n_fats; /* Number of FATs (1 or 2) */
BYTE wflag; /* win[] status (b0:dirty) */ BYTE wflag; /* win[] status (b0:dirty) */
BYTE fsi_flag; /* Allocation information control (b7:disabled, b0:dirty) */ BYTE fsi_flag; /* Allocation information control (b7:disabled, b0:dirty) */
WORD id; /* Volume mount ID */ WORD id; /* Volume mount ID */
WORD n_rootdir; /* Number of root directory entries (FAT12/16) */ WORD n_rootdir; /* Number of root directory entries (FAT12/16) */
WORD csize; /* Cluster size [sectors] */ WORD csize; /* Cluster size [sectors] */
#if FF_MAX_SS != FF_MIN_SS #if FF_MAX_SS != FF_MIN_SS
WORD ssize; /* Sector size (512, 1024, 2048 or 4096) */ WORD ssize; /* Sector size (512, 1024, 2048 or 4096) */
#endif #endif
#if FF_USE_LFN #if FF_USE_LFN
WCHAR *lfnbuf; /* LFN working buffer */ WCHAR* lfnbuf; /* Pointer to LFN working buffer */
#endif #endif
#if !FF_FS_READONLY #if !FF_FS_READONLY
DWORD last_clst; /* Last allocated cluster (Unknown if >=n_fatent) */ DWORD last_clst; /* Last allocated cluster (invalid if >=n_fatent) */
DWORD free_clst; /* Number of free clusters (Unknown if >=fs->n_fatent-2) */ DWORD free_clst; /* Number of free clusters (invalid if >=fs->n_fatent-2) */
#endif #endif
#if FF_FS_RPATH #if FF_FS_RPATH
DWORD cdir; /* Current directory start cluster (0:root) */ DWORD cdir; /* Current directory start cluster (0:root) */
#endif #endif
DWORD n_fatent; /* Number of FAT entries (number of clusters + 2) */ DWORD n_fatent; /* Number of FAT entries (number of clusters + 2) */
DWORD fsize; /* Number of sectors per FAT */ DWORD fsize; /* Number of sectors per FAT */
LBA_t winsect; /* Current sector appearing in the win[] */ LBA_t winsect; /* Current sector appearing in the win[] */
LBA_t volbase; /* Volume base sector */ LBA_t volbase; /* Volume base sector */
LBA_t fatbase; /* FAT base sector */ LBA_t fatbase; /* FAT base sector */
LBA_t dirbase; /* Root directory base sector (FAT12/16) or cluster (FAT32/exFAT) */ LBA_t dirbase; /* Root directory base sector (FAT12/16) or cluster (FAT32/exFAT) */
LBA_t database; /* Data base sector */ LBA_t database; /* Data base sector */
#if FF_FS_EXFAT #if FF_FS_EXFAT
LBA_t bitbase; /* Allocation bitmap base sector */ LBA_t bitbase; /* Allocation bitmap base sector */
BYTE *dirbuf; /* Directory entry block scratchpad buffer for exFAT */ BYTE* dirbuf; /* Pointer to directory entry block buffer */
DWORD cdc_scl; /* Containing directory start cluster (invalid when cdir is 0) */ #if FF_FS_RPATH
DWORD cdc_size; /* b31-b8:Size of containing directory, b7-b0: Chain status */ FFXCWDS xcwds; /* Crrent working directory structure */
DWORD cdc_ofs; /* Offset in the containing directory (invalid when cdir is 0) */ FFXCWDS xcwds2; /* Working buffer to follow the path */
#endif #endif
BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */ #endif
BYTE win[FF_MAX_SS]; /* Disk access window for directory, FAT (and file data in tiny cfg) */
} FATFS; } FATFS;
@ -175,21 +193,21 @@ typedef struct {
/* Object ID and allocation information (FFOBJID) */ /* Object ID and allocation information (FFOBJID) */
typedef struct { typedef struct {
FATFS* fs; /* Pointer to the hosting volume of this object */ FATFS* fs; /* Pointer to the volume holding this object */
WORD id; /* Hosting volume's mount ID */ WORD id; /* Volume mount ID when this object was opened */
BYTE attr; /* Object attribute */ BYTE attr; /* Object attribute */
BYTE stat; /* Object chain status (b1-0: =0:not contiguous, =2:contiguous, =3:fragmented in this session, b2:sub-directory stretched) */ BYTE stat; /* Object chain status (exFAT: b1-0: =0:not contiguous, =2:contiguous, =3:fragmented in this session, b2:sub-directory stretched) */
DWORD sclust; /* Object data start cluster (0:no cluster or root directory) */ DWORD sclust; /* Object data cluster (0:no data or root directory) */
FSIZE_t objsize; /* Object size (valid when sclust != 0) */ FSIZE_t objsize; /* Object size (valid when sclust != 0) */
#if FF_FS_EXFAT #if FF_FS_EXFAT
DWORD n_cont; /* Size of first fragment - 1 (valid when stat == 3) */ DWORD n_cont; /* Size of first fragment - 1 (valid when stat == 3) */
DWORD n_frag; /* Size of last fragment needs to be written to FAT (valid when not zero) */ DWORD n_frag; /* Size of last fragment needs to be written to FAT (valid when not zero) */
DWORD c_scl; /* Containing directory start cluster (valid when sclust != 0) */ DWORD c_scl; /* Cluster of directory holding this object (valid when sclust != 0) */
DWORD c_size; /* b31-b8:Size of containing directory, b7-b0: Chain status (valid when c_scl != 0) */ DWORD c_size; /* Size of directory holding this object (b7-b0: allocation status, valid when c_scl != 0) */
DWORD c_ofs; /* Offset in the containing directory (valid when in file object and sclust != 0) */ DWORD c_ofs; /* Offset of entry in the holding directory */
#endif #endif
#if FF_FS_LOCK #if FF_FS_LOCK
UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */ UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */
#endif #endif
} FFOBJID; } FFOBJID;
@ -198,18 +216,18 @@ typedef struct {
/* File object structure (FIL) */ /* File object structure (FIL) */
typedef struct { typedef struct {
FFOBJID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */ FFOBJID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */
BYTE flag; /* File status flags */ BYTE flag; /* File status flags */
BYTE err; /* Abort flag (error code) */ BYTE err; /* Abort flag (error code) */
FSIZE_t fptr; /* File read/write pointer (Zeroed on file open) */ FSIZE_t fptr; /* File read/write pointer (0 on open) */
DWORD clust; /* Current cluster of fpter (invalid when fptr is 0) */ DWORD clust; /* Current cluster of fptr (invalid when fptr is 0) */
LBA_t sect; /* Sector number appearing in buf[] (0:invalid) */ LBA_t sect; /* Sector number appearing in buf[] (0:invalid) */
#if !FF_FS_READONLY #if !FF_FS_READONLY
LBA_t dir_sect; /* Sector number containing the directory entry (not used at exFAT) */ LBA_t dir_sect; /* Sector number containing the directory entry (not used in exFAT) */
BYTE* dir_ptr; /* Pointer to the directory entry in the win[] (not used at exFAT) */ BYTE* dir_ptr; /* Pointer to the directory entry in the win[] (not used in exFAT) */
#endif #endif
#if FF_USE_FASTSEEK #if FF_USE_FASTSEEK
DWORD* cltbl; /* Pointer to the cluster link map table (nulled on open, set by application) */ DWORD* cltbl; /* Pointer to the cluster link map table (nulled on open; set by application) */
#endif #endif
#if !FF_FS_TINY #if !FF_FS_TINY
BYTE buf[FF_MAX_SS]; /* File private data read/write window */ BYTE buf[FF_MAX_SS]; /* File private data read/write window */
@ -221,44 +239,44 @@ typedef struct {
/* Directory object structure (DIR) */ /* Directory object structure (DIR) */
typedef struct { typedef struct {
FFOBJID obj; /* Object identifier */ FFOBJID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */
DWORD dptr; /* Current read/write offset */ DWORD dptr; /* Current read/write offset */
DWORD clust; /* Current cluster */ DWORD clust; /* Current cluster */
LBA_t sect; /* Current sector (0:Read operation has terminated) */ LBA_t sect; /* Current sector (0:no more item to read) */
BYTE* dir; /* Pointer to the directory item in the win[] */ BYTE* dir; /* Pointer to the directory item in the win[] in filesystem object */
BYTE fn[12]; /* SFN (in/out) {body[8],ext[3],status[1]} */ BYTE fn[12]; /* SFN (in/out) {body[0-7],ext[8-10],status[11]} */
#if FF_USE_LFN #if FF_USE_LFN
DWORD blk_ofs; /* Offset of current entry block being processed (0xFFFFFFFF:Invalid) */ DWORD blk_ofs; /* Offset of current entry block being processed (0xFFFFFFFF:invalid) */
#endif #endif
#if FF_USE_FIND #if FF_USE_FIND
const TCHAR* pat; /* Pointer to the name matching pattern */ const TCHAR *pat; /* Pointer to the name matching pattern */
#endif #endif
} DIR; } DIR;
/* File information structure (FILINFO) */ /* File/directory information structure (FILINFO) */
typedef struct { typedef struct {
FSIZE_t fsize; /* File size */ FSIZE_t fsize; /* File size (invalid for directory) */
WORD fdate; /* Modified date */ WORD fdate; /* Date of file modification or directory creation */
WORD ftime; /* Modified time */ WORD ftime; /* Time of file modification or directory creation */
#if FF_FS_CRTIME #if FF_FS_CRTIME
WORD crdate; /* Created date */ WORD crdate; /* Date of object createion */
WORD crtime; /* Created time */ WORD crtime; /* Time of object createion */
#endif #endif
BYTE fattrib; /* File attribute */ BYTE fattrib; /* Object attribute */
#if FF_USE_LFN #if FF_USE_LFN
TCHAR altname[FF_SFN_BUF + 1];/* Alternative file name */ TCHAR altname[FF_SFN_BUF + 1];/* Alternative object name */
TCHAR fname[FF_LFN_BUF + 1]; /* Primary file name */ TCHAR fname[FF_LFN_BUF + 1]; /* Primary object name */
#else #else
TCHAR fname[12 + 1]; /* File name */ TCHAR fname[12 + 1]; /* Object name */
#endif #endif
} FILINFO; } FILINFO;
/* Format parameter structure (MKFS_PARM) */ /* Format parameter structure (MKFS_PARM) used for f_mkfs() */
typedef struct { typedef struct {
BYTE fmt; /* Format option (FM_FAT, FM_FAT32, FM_EXFAT and FM_SFD) */ BYTE fmt; /* Format option (FM_FAT, FM_FAT32, FM_EXFAT and FM_SFD) */
@ -290,7 +308,7 @@ typedef enum {
FR_MKFS_ABORTED, /* (14) The f_mkfs function aborted due to some problem */ FR_MKFS_ABORTED, /* (14) The f_mkfs function aborted due to some problem */
FR_TIMEOUT, /* (15) Could not take control of the volume within defined period */ FR_TIMEOUT, /* (15) Could not take control of the volume within defined period */
FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */ FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */
FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated or given buffer is insufficient in size */ FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated, given buffer size is insufficient or too deep path */
FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > FF_FS_LOCK */ FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > FF_FS_LOCK */
FR_INVALID_PARAMETER /* (19) Given parameter is invalid */ FR_INVALID_PARAMETER /* (19) Given parameter is invalid */
} FRESULT; } FRESULT;

View File

@ -2,7 +2,7 @@
/ Configurations of FatFs Module / Configurations of FatFs Module
/---------------------------------------------------------------------------*/ /---------------------------------------------------------------------------*/
#define FFCONF_DEF 5385 /* Revision ID */ #define FFCONF_DEF 80386 /* Revision ID */
/*---------------------------------------------------------------------------/ /*---------------------------------------------------------------------------/
/ Function Configurations / Function Configurations
@ -57,9 +57,9 @@
#define FF_USE_STRFUNC 0 #define FF_USE_STRFUNC 0
#define FF_PRINT_LLI 1 #define FF_PRINT_LLI 0
#define FF_PRINT_FLOAT 1 #define FF_PRINT_FLOAT 0
#define FF_STRF_ENCODE 3 #define FF_STRF_ENCODE 0
/* FF_USE_STRFUNC switches string API functions, f_gets(), f_putc(), f_puts() and /* FF_USE_STRFUNC switches string API functions, f_gets(), f_putc(), f_puts() and
/ f_printf(). / f_printf().
/ /
@ -154,14 +154,26 @@
#define FF_FS_RPATH 0 #define FF_FS_RPATH 0
/* This option configures support for relative path. /* This option configures support for relative path feature.
/ /
/ 0: Disable relative path and remove related API functions. / 0: Disable relative path and remove related API functions.
/ 1: Enable relative path. f_chdir() and f_chdrive() are available. / 1: Enable relative path and dot names. f_chdir() and f_chdrive() are available.
/ 2: f_getcwd() is available in addition to 1. / 2: f_getcwd() is available in addition to 1.
*/ */
#define FF_PATH_DEPTH 10
/* This option defines maximum depth of directory in the exFAT volume. It is NOT
/ relevant to FAT/FAT32 volume.
/ For example, FF_PATH_DEPTH = 3 will able to follow a path "/dir1/dir2/dir3/file"
/ but a sub-directory in the dir3 will not able to be followed and set current
/ directory.
/ The size of filesystem object (FATFS) increases FF_PATH_DEPTH * 24 bytes.
/ When FF_FS_EXFAT == 0 or FF_FS_RPATH == 0, this option has no effect.
*/
/*---------------------------------------------------------------------------/ /*---------------------------------------------------------------------------/
/ Drive/Volume Configurations / Drive/Volume Configurations
/---------------------------------------------------------------------------*/ /---------------------------------------------------------------------------*/
@ -226,7 +238,7 @@
#define FF_FS_TINY 0 #define FF_FS_TINY 0
/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) /* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)
/ At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes. / At the tiny configuration, size of file object (FIL) is reduced FF_MAX_SS bytes.
/ Instead of private sector buffer eliminated from the file object, common sector / Instead of private sector buffer eliminated from the file object, common sector
/ buffer in the filesystem object (FATFS) is used for the file data transfer. */ / buffer in the filesystem object (FATFS) is used for the file data transfer. */
@ -238,7 +250,7 @@
#define FF_FS_NORTC 0 #define FF_FS_NORTC 0
#define FF_NORTC_MON 6 #define FF_NORTC_MON 1
#define FF_NORTC_MDAY 1 #define FF_NORTC_MDAY 1
#define FF_NORTC_YEAR 2025 #define FF_NORTC_YEAR 2025
/* The option FF_FS_NORTC switches timestamp feature. If the system does not have /* The option FF_FS_NORTC switches timestamp feature. If the system does not have