Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 30ca13c626 | |||
| 5f85a520a9 | |||
| 79eff96e0b | |||
| ff60b17ea7 | |||
| 44b3c38b23 |
@@ -31,6 +31,7 @@ hr {border-width: 1px; margin: 1em;}
|
||||
div.abst {font-family: sans-serif;}
|
||||
div.para {clear: both; font-family: serif;}
|
||||
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;}
|
||||
.indent {margin-left: 2em;}
|
||||
.rset {float: right; margin: 0.3em 0 0.5em 0.5em;}
|
||||
@@ -38,6 +39,7 @@ div.ret a {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;
|
||||
ul.flat li {list-style-type: none; margin: 0;}
|
||||
a.imglnk img {border: 1px solid;}
|
||||
.iequ {white-space: nowrap; font-weight: bold;}
|
||||
.lnk {opacity: 0.5;}
|
||||
.clr {clear: both;}
|
||||
.it {font-style: italic;}
|
||||
.mfd {font-size: 0.7em; padding: 0 1px; border: 1px solid; white-space : nowrap}
|
||||
|
||||
+175
-176
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/appnote.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs Module Application Note</title>
|
||||
</head>
|
||||
@@ -81,7 +79,7 @@ The FatFs module is a middleware written in ANSI C (C89). There is no platform d
|
||||
<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td><a href="config.html#max_ss">FF_MAX_SS != FF_MIN_SS</a></td></tr>
|
||||
<tr><td>disk_ioctl (CTRL_TRIM)</td><td><a href="config.html#use_trim">FF_USE_TRIM == 1</a></td></tr>
|
||||
<tr><td>ff_uni2oem<br>ff_oem2uni<br>ff_wtoupper</td><td><a href="config.html#use_lfn">FF_USE_LFN != 0</a></td><td>Unicode support functions.<br>Add optional module ffunicode.c to the project.</td></tr>
|
||||
<tr><td>ff_cre_syncobj<br>ff_del_syncobj<br>ff_req_grant<br>ff_rel_grant</td><td><a href="config.html#fs_reentrant">FF_FS_REENTRANT == 1</a></td><td rowspan="2">O/S dependent functions.<br>Sample code is available in ffsystem.c.</td></tr>
|
||||
<tr><td>ff_mutex_create<br>ff_mutex_delete<br>ff_mutex_take<br>ff_mutex_give</td><td><a href="config.html#fs_reentrant">FF_FS_REENTRANT == 1</a></td><td rowspan="2">O/S dependent functions.<br>Sample code is available in ffsystem.c.</td></tr>
|
||||
<tr><td>ff_mem_alloc<br>ff_mem_free</td><td>FF_USE_LFN == 3</td></tr>
|
||||
</table>
|
||||
<p>FatFs cares about neither what kind of storage device is used nor how it is implemented. Only a requirement is that it is a block device read/written in fixed-size blocks that accessible via the disk I/O functions defined above.</p>
|
||||
@@ -92,7 +90,7 @@ The FatFs module is a middleware written in ANSI C (C89). There is no platform d
|
||||
<ul>
|
||||
<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 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>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>
|
||||
@@ -108,21 +106,21 @@ The FatFs module is a middleware written in ANSI C (C89). There is no platform d
|
||||
<tr><th></th><th>ARM7<small><br>32bit</small></th><th>ARM7<small><br>Thumb</small></th><th>CM3<small><br>Thumb-2</small></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>RL78</th><th>V850ES</th><th>SH-2A</th><th>RX600</th><th>IA-32</th></tr>
|
||||
<tr class="cal"> <td>Compiler</td><td>GCC</td><td>GCC</td><td>GCC</td><td>GCC</td><td>CH38</td><td>C30</td><td>CC78K0R</td><td>CA850</td><td>SHC</td><td>RXC</td><td>MSC</td></tr>
|
||||
<!-- ARM Thumb CM3 AVR H8 PIC24 RL78 V850ES SH-2A RX600 IA-32 -->
|
||||
<tr class="ral"><td class="cal">.text (Def, R/W)</td><td>10.4k</td><td>6.7k</td><td>6.1k</td><td>12.5k</td><td>11.0k</td><td>11.4k</td><td>13.0k</td><td>8.9k</td><td>9.2k</td><td>6.5k</td><td>8.9k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Min, R/W)</td> <td>7.0k</td><td>4.7k</td><td>4.2k</td> <td>8.5k</td> <td>7.6k</td> <td>7.9k</td> <td>9.5k</td><td>6.3k</td><td>6.4k</td><td>4.7k</td><td>6.4k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Def, R/O)</td> <td>4.9k</td><td>3.2k</td><td>2.7k</td> <td>6.1k</td> <td>5.2k</td> <td>5.4k</td> <td>6.5k</td><td>4.3k</td><td>4.2k</td><td>3.2k</td><td>4.3k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Min, R/O)</td> <td>3.7k</td><td>2.5k</td><td>2.1k</td> <td>4.4k</td> <td>4.0k</td> <td>4.2k</td> <td>5.1k</td><td>3.4k</td><td>3.3k</td><td>2.5k</td><td>3.5k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Def, R/W)</td><td>10.5k</td><td>6.7k</td><td>6.1k</td><td>12.6k</td><td>11.0k</td><td>11.4k</td><td>13.0k</td><td>8.9k</td><td>9.2k</td><td>6.5k</td><td>8.9k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Min, R/W)</td> <td>7.0k</td><td>4.7k</td><td>4.2k</td> <td>8.5k</td> <td>7.6k</td> <td>7.9k</td> <td>9.4k</td><td>6.3k</td><td>6.4k</td><td>4.7k</td><td>6.3k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Def, R/O)</td> <td>4.9k</td><td>3.2k</td><td>2.8k</td> <td>6.1k</td> <td>5.2k</td> <td>5.5k</td> <td>6.5k</td><td>4.4k</td><td>4.2k</td><td>3.2k</td><td>4.3k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Min, R/O)</td> <td>3.7k</td><td>2.5k</td><td>2.1k</td> <td>4.4k</td> <td>4.0k</td> <td>4.2k</td> <td>5.0k</td><td>3.4k</td><td>3.3k</td><td>2.5k</td><td>3.4k</td></tr>
|
||||
<tr class="ral"><td class="cal">.bss</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*2 + 2</td><td>V*4 + 2</td><td>V*2 + 2</td><td>V*2 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td></tr>
|
||||
<tr class="ral"><td class="cal">Work area<br><small>(FF_FS_TINY == 0)</small></td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td></tr>
|
||||
<tr class="ral"><td class="cal">Work area<br><small>(FF_FS_TINY == 1)</small></td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td></tr>
|
||||
</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>
|
||||
<pre>
|
||||
FatFs R0.15 options:
|
||||
FatFs R0.16 options:
|
||||
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_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>
|
||||
</div>
|
||||
|
||||
@@ -171,169 +169,170 @@ And any other options are left unchanged from original setting.
|
||||
|
||||
<div class="para doc" id="lfn">
|
||||
<h3>Long File Name</h3>
|
||||
<p>FatFs module supports the long file name (LFN) extension of the FAT filesystem. The two different file names, short file name (SFN) and LFN, of a file is transparent on the API. The support for LFN feature is disabled by default. To enable the LFN, set <tt><a href="config.html#use_lfn">FF_USE_LFN</a></tt> to 1, 2 or 3, and add <tt>ffunicode.c</tt> to the project. The LFN feature requiers a certain working buffer. The buffer size can be configured by <tt><a href="config.html#max_lfn">FF_MAX_LFN</a></tt> according to the available memory. The length of LFN can be up to 255 characters, so that the <tt>FF_MAX_LFN</tt> should be set to 255 for any existing file names. If the size of working buffer is insufficient for the input file name, the file function fails with <tt>FR_INVALID_NAME</tt>. When use any re-entry to the API with LFN feature in RTOS environment, <tt>FF_USE_LFN</tt> must be set to 2 or 3. In this case, the file function allocates the working buffer on the stack or heap. The LFN 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.</p>
|
||||
<h4>Impact upon Module Size</h4>
|
||||
<table class="lst2 rset">
|
||||
<caption>With LFN at CM3 + gcc</caption>
|
||||
<tr><th><tt>FF_CODE_PAGE</tt></th><th>Code size</th></tr>
|
||||
<tr><td>437-869 (SBCS)</td><td>+3.3k</td></tr>
|
||||
<tr><td>932 (Japanese)</td><td>+62k</td></tr>
|
||||
<tr><td>936 (Simplified Chinese)</td><td>+177k</td></tr>
|
||||
<tr><td>949 (Korean)</td><td>+140k</td></tr>
|
||||
<tr><td>950 (Traditional Chinese)</td><td>+111k</td></tr>
|
||||
<tr><td>0 (All code pages)</td><td>+486k</td></tr>
|
||||
</table>
|
||||
<p>When the LFN is enabled, the module size will be increased depends on the configured code page. Right table shows the increment of code size in some code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased as shown in the table.</p>
|
||||
<p>As the result, the FatFs with LFN enabled with DBCS code pages will not able to be ported on the most 8-bit MCU systems. If the target system is in legacy-free, in only Unicode and any ANSI/OEM code is not used at all, the code page setting gets meaningless. You will able to reduce the code size by configureing FatFs for Unicode API with any SBCS code page.</p>
|
||||
<p>There ware some restrictions on using LFN for open source project, because the LFN extension on the FAT filesystem was a patent of Microsoft Corporation. However the related patents all have expired and using the LFN feature is free for any projects.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="unicode">
|
||||
<h3>Unicode API</h3>
|
||||
<p>By default, FatFs uses ANSI/OEM code set on the API even in LFN configuration. FatFs can also switch the character encoding on the API to Unicode by configuration option <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a></tt>. This means that FatFs is compliant with the full featured LFN specification. The data type <tt>TCHAR</tt> specifies path name strings on the API is an alias of either <tt>char</tt>(ANSI/OEM or UTF-8), <tt>WCHAR</tt>(UTF-16) or <tt>DWORD</tt>(UTF-32) depends on that option. For more information, refer to the description in the <a href="filename.html#uni">file name</a>.</p>
|
||||
<p>Note that setting of code page, <tt><a href="config.html#code_page">FF_CODE_PAGE</a></tt>, has actually no meaning when FatFs is configured for the Unicode API. It should be set 437 to reduce the module size. However it still affects code conversion of string I/O functions when <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a> == 0</tt>, and also backward compatibility with legacy systems. In this case, the code page may need to be configured properly if it is considered a problem.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="exfat">
|
||||
<h3>exFAT Filesystem</h3>
|
||||
<p>The exFAT (Microsoft's Extended File Allocation Table) filesystem is a succession of the FAT/FAT32 filesystem which has been widely used in embedded systems, consumer devices and portable storage media. It is adopted by SDA (SD Association) as the filesystem for SDXC card, 64 GB and larger, and they are being shipped with this format. Therefore the exFAT is one of the standard filesystems for removable media as well as FAT. The exFAT filesystem allows the file size beyond the 4 GB limit what FAT filesystem allows up to and some filesystem overhead, especially cluster allocation delay, are reduced as well. These features allow to record the large data without dividing into some files and improve the write throughput to the file.</p>
|
||||
<p>Note that the exFAT filesystem is a patent of Microsoft Corporation. The exFAT feature of FatFs is an implementation based on <cite>US. Pat. App. Pub. No. 2009/0164440 A1</cite>. FatFs module can switch the exFAT on or off by a configuration option, <tt><a href="config.html#fs_exfat">FF_FS_EXFAT</a></tt>. When enable the exFAT for the commercial products, a license by Microsoft will be needed depends on the final destination of the products.</p>
|
||||
<p><em>Remarks: Enabling exFAT discards C89 compatibility and it wants C99 because of need for 64-bit integer type.</em></p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="lba64">
|
||||
<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>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 partiotion 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 class="para doc" id="reentrant">
|
||||
<h3>Re-entrancy</h3>
|
||||
<p>The file operations of two tasks to the <em>different volumes</em> each other is always re-entrant and it can work concurrently without any mutual exclusion regardless of the configurations except when LFN is enabled with static working buffer (<tt>FF_USE_LFN = 1</tt>).</p>
|
||||
<p>The file operations of two tasks to the <em>same volume</em> is not thread-safe by default. FatFs can also be configured to make it thread-safe by an option <tt><a href="config.html#fs_reentrant">FF_FS_REENTRANT</a></tt>. When a file function is called while the volume is being accessed by another task, the file function to the volume will be suspended until that task leaves the file function. If the wait time exceeded a period defined by <tt>FF_TIMEOUT</tt>, the file function will abort with <tt>FR_TIMEOUT</tt>. The timeout feature might not be supported on the some OSs. To enable this feature, OS dependent synchronization control functions, <tt>ff_mutex_create/ff_mutex_delete/ff_mutex_take/ff_mutex_give</tt>, need to be added to the project. There is an example code in the <tt>ffsystem.c</tt> for some OSs.</p>
|
||||
<p>Note that there is an exception on the re-entrancy for <tt>f_mount</tt> and <tt>f_mkfs</tt> function. You will know why it is. These volume management functions are always not thread-safe to the volume being processed. When use these functions, other tasks need to avoid to access the corresponding volume.</p>
|
||||
<div class="rset">
|
||||
<table class="lst2">
|
||||
<tr><th><tt>Function</tt></th><th>Case 1</th><th>Case 2</th><th>Case 3</th></tr>
|
||||
<tr><td>disk_status</td><td>Yes</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>disk_initialize</td><td>No</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>disk_read</td><td>No</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>disk_write</td><td>No</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>disk_ioctl</td><td>No</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>get_fattime</td><td>No</td><td>Yes</td><td>Yes</td></tr>
|
||||
</table>
|
||||
<small>
|
||||
Case 1: Same volume.<br>
|
||||
Case 2: Different volume on the same drive.<br>
|
||||
Case 3: Different volume on the different drive.<br>
|
||||
(*) In only different drive number.
|
||||
</small>
|
||||
</div>
|
||||
<p>Remarks: This section describes on the re-entrancy of the FatFs module itself. The <tt>FF_FS_REENTRANT</tt> option enables only exclusive use of each filesystem objects and FatFs does not that prevent to re-enter the storage device control functions. Thus the device control layer needs to be always thread-safe when FatFs API is re-entered for different volumes. Right table shows which control function can be re-entered when FatFs API is re-entered on some conditions.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="dup">
|
||||
<h3>Duplicated File Open</h3>
|
||||
<p>FatFs module does not support the read/write collision control of duplicated open to a file. The duplicated open is permitted only when each of open method to a file is read mode. The duplicated open with one or more write mode to a file is always prohibited, and also open file must not be renamed or deleted. A violation of these rules can cause data collaption.</p>
|
||||
<p>The file lock control can be enabled by <tt><a href="config.html#fs_lock">FF_FS_LOCK</a></tt> option. The value of option defines the number of open objects to manage simultaneously. In this case, if any opening, renaming or removing against the file shareing rule that described above is attempted, the file function will be rejected with <tt>FR_LOCKED</tt>. If number of open objects, files and sub-directories, is equal to <tt>FF_FS_LOCK</tt>, an extra <tt>f_open/f_opendir</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="fs1">
|
||||
<h3>Performance Effective File Access</h3>
|
||||
<p>For good read/write throughput on the small embedded systems with limited size of memory, application programmer should consider what process is done in the FatFs module. The file data on the volume is transferred in following sequence by <tt>f_read</tt> function.</p>
|
||||
<p>Figure 1. Sector unaligned read (short)<br>
|
||||
<img src="../res/f1.png" width="490" height="110" alt="">
|
||||
</p>
|
||||
<p>Figure 2. Sector unaligned read (long)<br>
|
||||
<img src="../res/f2.png" width="490" height="140" alt="">
|
||||
</p>
|
||||
<p>Figure 3. Fully sector aligned read<br>
|
||||
<img src="../res/f3.png" width="490" height="119" alt="">
|
||||
</p>
|
||||
<p>The file I/O buffer is a sector buffer to read/write a part of data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the filesystem object. The buffer configuration option <tt><a href="config.html#fs_tiny">FF_FS_TINY</a></tt> determins which sector buffer is used for the file data transfer. When tiny buffer configuration (1) is selected, data memory consumption is reduced <tt>FF_MAX_SS</tt> bytes each file object. In this case, FatFs module uses only a sector buffer in the filesystem object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.</p>
|
||||
<p>Figure 1 shows that a partial sector, sector unaligned part of the file, is transferred via the file I/O buffer. At long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to the application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with <tt>disk_read</tt> function at a time but the multiple sector transfer is divided at cluster boundary even if it is contiguous.</p>
|
||||
<p>Therefore taking effort to sector aligned read/write accesss eliminates buffered data transfer and the read/write performance will be improved. Besides the effect, cached FAT data will not be flushed by file data transfer at the tiny configuration, so that it can achieve same performance as non-tiny configuration with small memory footprint.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="fs2">
|
||||
<h3>Considerations on Flash Memory Media</h3>
|
||||
<p>To maximize the write performance of flash memory media, such as SDC, CFC and U Disk, it must be controlled in consideration of its characteristitcs.</p>
|
||||
<h4>Using Mutiple-Sector Write</h4>
|
||||
<div class="rset">
|
||||
Figure 6. Comparison between Multiple/Single Sector Write<br>
|
||||
<img src="../res/f6.png" width="630" height="148" alt="fig.6">
|
||||
</div>
|
||||
<p>The write throughput of the flash memory media becomes the worst at single sector write transaction. The write throughput increases as the number of sectors per a write transaction as shown in Figure 6. This effect more appers at faster interface speed and the performance ratio often becomes grater than ten. <a href="../res/rwtest2.png">This result</a> is clearly explaining how fast is multiple block write (W:16K, 32 sectors) than single block write (W:100, 1 sector), and also larger card tends to be slow at single block write. Number of write transactions also affects life time of the flash memory media. When compared at same amount of write data, the single sector write in Figure 6 above wears flash memory media 16 times more than multiple sector write in Figure 6 below. Single sector write is pretty pain for the flash memory media.</p>
|
||||
<p>Therefore the application program should write the data in large block as possible. The ideal write chunk size and alighment is size of sector, and size of cluster is the best. Of course all layers between the application and the storage device must have consideration on multiple sector write, however most of open-source memory card drivers lack it. Do not split a multiple sector write request into single sector write transactions or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write operation. </p>
|
||||
<h4>Forcing Memory Erase</h4>
|
||||
<p>When remove a file with <tt>f_unlink</tt> function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as 'live block'. If the file data can be erased on removing the file, those data blocks will be turned into the free block pool. This may skip internal block erase operation to the data block on next write operation. As the result the write performance might be improved. FatFs can manage this function by setting <tt><a href="config.html#use_trim">FF_USE_TRIM</a></tt> to 1. Note that because this effect is from an expectation of internal process of the storage device, it is not that always effective. Most applications will not need this function. Also <tt>f_unlink</tt> function can take a time when remove a large file.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="critical">
|
||||
<h3>Critical Section</h3>
|
||||
<p>If a write operation to the FAT volume is interrupted due to an accidental failure, such as sudden blackout, wrong media removal and unrecoverable disk error, the FAT structure on the volume can be broken. Following images shows the critical section of the FatFs module.</p>
|
||||
<div class="lset">
|
||||
Figure 4. Long critical section<br>
|
||||
<img src="../res/f4.png" width="320" height="436" alt="fig.4">
|
||||
</div>
|
||||
<div class="lset">
|
||||
Figure 5. Minimized critical section<br>
|
||||
<img src="../res/f5.png" width="320" height="436" alt="fig.5">
|
||||
</div>
|
||||
<br class="clr">
|
||||
<p>An interruption in the red section can cause a cross link; as a result, the object being changed can be lost. If an interruption in the yellow section is occured, there is one or more possibility listed below.</p>
|
||||
<ul>
|
||||
<li>The file data being rewrited is collapsed.</li>
|
||||
<li>The file being appended returns initial state.</li>
|
||||
<li>The file created as new is gone.</li>
|
||||
<li>The file created as new or overwritten remains but no content.</li>
|
||||
<li>Efficiency of disk use gets worse due to lost clusters.</li>
|
||||
</ul>
|
||||
<p>Each case does not affect any file not opened in write mode. To minimize risk of data loss, the critical section can be minimized by minimizing the time that file is opened in write mode or using <tt>f_sync</tt> function as shown in Figure 5.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="fs3">
|
||||
<h3>Various Usable Functions for FatFs Projects</h3>
|
||||
<p>These are examples of extended use of FatFs APIs. New item will be added when useful code example is found.</p>
|
||||
<ol>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app1.c">Open or Create File for Append</a> (superseded by FA_OPEN_APPEND flag added at R0.12)</li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app2.c">Delete Non-empty Sub-directory</a> (for R0.12 and later)</li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app3.c">Create Contiguous File</a> (superseded by f_expand function added at R0.12)</li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app5.c">Test if the File is Contiguous or Not</a></li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app4.c">Compatibility Checker for Storage Device Control Module</a></li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app6.c">Performance Checker for Storage Device Control Module</a></li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/mkfatimg.zip">FAT Volume Image Creator</a> (Pre-creating built-in FAT volume)</li>
|
||||
<li>Virtual Drive Feature (refer to lpc176x/ in <a href="../ffsample.zip">ffsample.zip</a>)</li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/uniconv.zip">Embedded Unicode String Utilities</a> (OEMxxx→Unicode, Unicode→OEMxxx, Unicode→Unicode)</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="license">
|
||||
<h3>About FatFs License</h3>
|
||||
<p>FatFs has being developped as a personal project of the author, ChaN. It is free from the code anyone else wrote at current release. Following code block shows a copy of the FatFs license document that included in the source files.</p>
|
||||
<pre>
|
||||
/*----------------------------------------------------------------------------/
|
||||
/ FatFs - Generic FAT Filesystem Module Rx.xx /
|
||||
/-----------------------------------------------------------------------------/
|
||||
/
|
||||
/ Copyright (C) 20xx, ChaN, all right reserved.
|
||||
/
|
||||
/ FatFs module is an open source software. Redistribution and use of FatFs in
|
||||
/ source and binary forms, with or without modification, are permitted provided
|
||||
/ that the following condition is met:
|
||||
/
|
||||
/ 1. Redistributions of source code must retain the above copyright notice,
|
||||
/ this condition and the following disclaimer.
|
||||
/
|
||||
/ This software is provided by the copyright holder and contributors "AS IS"
|
||||
/ and any warranties related to this software are DISCLAIMED.
|
||||
/ The copyright owner or contributors be NOT LIABLE for any damages caused
|
||||
/ by use of this software.
|
||||
/----------------------------------------------------------------------------*/
|
||||
</pre>
|
||||
<p>Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. FatFs is mainly intended for embedded systems. In order to extend the usability for commercial products, the redistributions of FatFs in binary form, such as embedded code, binary library and any forms without source code, does not need to include about FatFs in the documentations. This is equivalent to the 1-clause BSD license. Of course FatFs is compatible with the most of open source software licenses includes GNU GPL. When you redistribute the FatFs source code with any changes or create a fork, the license can also be changed to GNU GPL, BSD-style license or any open source software license that compatible with FatFs license.</p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return Home</a></p>
|
||||
</body>
|
||||
</html>
|
||||
<p>FatFs module supports the long file name (LFN) extension of the FAT filesystem. The two different file names, short file name (SFN) and LFN, of a file are transparent on the API. The support for LFN feature is disabled by default. To enable the LFN, set <tt><a href="config.html#use_lfn">FF_USE_LFN</a></tt> to 1, 2 or 3, and add <tt>ffunicode.c</tt> to the project. The LFN feature requiers a certain working buffer. The buffer size can be configured by <tt><a href="config.html#max_lfn">FF_MAX_LFN</a></tt> according to the available memory. The LFN specification allows the length of LFN up to 255 characters, so that the <tt>FF_MAX_LFN</tt> should be set to 255 for every existing file name. If the size of working buffer is insufficient for the input file name, the file function fails with <tt>FR_INVALID_NAME</tt>. When use any re-entry to the file API with LFN feature in RTOS environment, <tt>FF_USE_LFN</tt> must be set to 2 or 3. In this case, the file function allocates the working buffer on the stack or heap. The LFN 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.</p>
|
||||
<h4>Code Page and Module Size</h4>
|
||||
<table class="lst2 rset">
|
||||
<caption>With LFN at CM3 + gcc</caption>
|
||||
<tr><th><tt>FF_CODE_PAGE</tt></th><th>Code size</th></tr>
|
||||
<tr><td>437-869 (SBCS)</td><td>+3.3k</td></tr>
|
||||
<tr><td>932 (Japanese)</td><td>+62k</td></tr>
|
||||
<tr><td>936 (Simplified Chinese)</td><td>+177k</td></tr>
|
||||
<tr><td>949 (Korean)</td><td>+140k</td></tr>
|
||||
<tr><td>950 (Traditional Chinese)</td><td>+111k</td></tr>
|
||||
<tr><td>0 (All code pages)</td><td>+486k</td></tr>
|
||||
</table>
|
||||
<p>When the LFN is enabled, the module size will be increased depends on the configured code page. Right table shows the increment of code size in some code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased as shown in the table.</p>
|
||||
<p>As the result, the FatFs with LFN enabled with DBCS code pages will not able to be ported on the most 8-bit MCU systems. If the target system is in legacy-free, in only Unicode and any ANSI/OEM code is not used at all, the code page setting is meaningless. You will able to reduce the code size by configureing FatFs for Unicode API with some SBCS code page.</p>
|
||||
<p>There ware some restrictions on using the LFN in open source project, because the LFN extension on the FAT filesystem was a patent of Microsoft Corporation. However the related patents all have expired and using the LFN feature is free for any project.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="unicode">
|
||||
<h3>Unicode API</h3>
|
||||
<p>By default, FatFs uses ANSI/OEM code set on the API even in LFN configuration. FatFs can also switch the character encoding on the API to Unicode by configuration option <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a></tt>. This means that FatFs is compliant with the full featured LFN specification. The data type <tt>TCHAR</tt> specifies path name strings on the API is an alias of either <tt>char</tt>(ANSI/OEM or UTF-8), <tt>WCHAR</tt>(UTF-16) or <tt>DWORD</tt>(UTF-32) depends on that option. For more information, refer to the description in the <a href="filename.html#uni">file name</a>.</p>
|
||||
<p>Note that setting of code page, <tt><a href="config.html#code_page">FF_CODE_PAGE</a></tt>, has actually no meaning when FatFs is configured for the Unicode API. It should be set 437 to reduce the module size. However it still affects code conversion of string I/O functions when <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a> == 0</tt>, and also backward compatibility with legacy systems. In this case, the code page may need to be configured properly if it is considered a problem.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="exfat">
|
||||
<h3>exFAT Filesystem</h3>
|
||||
<p>The exFAT (Microsoft's Extended File Allocation Table) filesystem is a succession of the FAT/FAT32 filesystem which has been widely used in embedded systems, consumer devices and portable storage media. It is adopted by SDA (SD Association) as the filesystem for SDXC card, 64 GB and larger, and they are being shipped with this format. Therefore the exFAT is one of the standard filesystems for removable media as well as FAT. The exFAT filesystem allows the file size beyond the 4 GB limit what FAT filesystem allows up to and some filesystem overhead, especially cluster allocation delay, are reduced as well. These features allow to record the large data without dividing into some files and improve the write throughput to the file.</p>
|
||||
<p>Note that the exFAT filesystem is a patent of Microsoft Corporation. The exFAT feature of FatFs is an implementation based on <cite>US. Pat. App. Pub. No. 2009/0164440 A1</cite>. FatFs module can switch the exFAT on or off by a configuration option, <tt><a href="config.html#fs_exfat">FF_FS_EXFAT</a></tt>. When enable the exFAT for the commercial products, a license by Microsoft will be needed depends on the final destination of the products.</p>
|
||||
<p><em>Remarks: Enabling exFAT discards C89 compatibility and it wants C99 because of need for 64-bit integer type.</em></p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="lba64">
|
||||
<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>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 class="para doc" id="reentrant">
|
||||
<h3>Re-entrancy</h3>
|
||||
<p>The file operations of two tasks to the <em>different volumes</em> each other is always re-entrant and it can work concurrently without any mutual exclusion regardless of the configurations except when LFN is enabled with static working buffer (<tt>FF_USE_LFN = 1</tt>).</p>
|
||||
<p>The file operations of two tasks to the <em>same volume</em> is not thread-safe by default. FatFs can also be configured to make it thread-safe by an option <tt><a href="config.html#fs_reentrant">FF_FS_REENTRANT</a></tt>. When a file function is called while the volume is being accessed by another task, the file function to the volume will be suspended until that task leaves the file function. If the wait time exceeded a period defined by <tt>FF_TIMEOUT</tt>, the file function will abort with <tt>FR_TIMEOUT</tt>. The timeout feature might not be supported on the some OSs. To enable this feature, OS dependent synchronization control functions, <tt>ff_mutex_create/ff_mutex_delete/ff_mutex_take/ff_mutex_give</tt>, need to be added to the project. There is an example code in the <tt>ffsystem.c</tt> for some OSs.</p>
|
||||
<p>Note that there is an exception on the re-entrancy for <tt>f_mount</tt> and <tt>f_mkfs</tt> function. You will know why it is. These volume management functions are always not thread-safe to the volume being processed. When use these functions, other tasks need to avoid to access the corresponding volume.</p>
|
||||
<div class="rset">
|
||||
<table class="lst2">
|
||||
<tr><th><tt>Function</tt></th><th>Case 1</th><th>Case 2</th><th>Case 3</th></tr>
|
||||
<tr><td>disk_status</td><td>Yes</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>disk_initialize</td><td>No</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>disk_read</td><td>No</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>disk_write</td><td>No</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>disk_ioctl</td><td>No</td><td>Yes</td><td>Yes(*)</td></tr>
|
||||
<tr><td>get_fattime</td><td>No</td><td>Yes</td><td>Yes</td></tr>
|
||||
</table>
|
||||
<small>
|
||||
Case 1: Same volume.<br>
|
||||
Case 2: Different volume on the same drive.<br>
|
||||
Case 3: Different volume on the different drive.<br>
|
||||
(*) In only different drive number.
|
||||
</small>
|
||||
</div>
|
||||
<p>Remarks: This section describes on the re-entrancy of the FatFs module itself. The <tt>FF_FS_REENTRANT</tt> option enables only exclusive use of each filesystem objects and FatFs does not that prevent to re-enter the storage device control functions. Thus the device control layer needs to be always thread-safe when FatFs API is re-entered for different volumes. Right table shows which control function can be re-entered when FatFs API is re-entered on some conditions.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="dup">
|
||||
<h3>Duplicated File Open</h3>
|
||||
<p>FatFs module does not support the read/write collision control of duplicated open to a file. The duplicated open is permitted only when each of open method to a file is read mode. The duplicated open with one or more write mode to a file is always prohibited, and also open file must not be renamed or deleted. A violation of these rules can cause data collaption.</p>
|
||||
<p>The file lock control can be enabled by <tt><a href="config.html#fs_lock">FF_FS_LOCK</a></tt> option. The value of option defines the number of open objects to manage simultaneously. In this case, if any opening, renaming or removing against the file shareing rule that described above is attempted, the file function will be rejected with <tt>FR_LOCKED</tt>. If number of open objects, files and sub-directories, is equal to <tt>FF_FS_LOCK</tt>, an extra <tt>f_open/f_opendir</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="fs1">
|
||||
<h3>Performance Effective File Access</h3>
|
||||
<p>For good read/write throughput on the small embedded systems with limited size of memory, application programmer should consider what process is done in the FatFs module. The file data on the volume is transferred in following sequence by <tt>f_read</tt> function.</p>
|
||||
<p>Figure 1. Sector unaligned read (short)<br>
|
||||
<img src="../res/f1.png" width="490" height="110" alt="">
|
||||
</p>
|
||||
<p>Figure 2. Sector unaligned read (long)<br>
|
||||
<img src="../res/f2.png" width="490" height="140" alt="">
|
||||
</p>
|
||||
<p>Figure 3. Fully sector aligned read<br>
|
||||
<img src="../res/f3.png" width="490" height="119" alt="">
|
||||
</p>
|
||||
<p>The file I/O buffer is a sector buffer to read/write a part of data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the filesystem object. The buffer configuration option <tt><a href="config.html#fs_tiny">FF_FS_TINY</a></tt> determins which sector buffer is used for the file data transfer. When tiny buffer configuration (1) is selected, data memory consumption is reduced <tt>FF_MAX_SS</tt> bytes each file object. In this case, FatFs module uses only a sector buffer in the filesystem object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.</p>
|
||||
<p>Figure 1 shows that a partial sector, sector unaligned part of the file, is transferred via the file I/O buffer. At long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to the application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with <tt>disk_read</tt> function at a time but the multiple sector transfer is divided at cluster boundary even if it is contiguous.</p>
|
||||
<p>Therefore taking effort to sector aligned read/write accesss eliminates buffered data transfer and the read/write performance will be improved. Besides the effect, cached FAT data will not be flushed by file data transfer at the tiny configuration, so that it can achieve same performance as non-tiny configuration with small memory footprint.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="fs2">
|
||||
<h3>Considerations on Flash Memory Media</h3>
|
||||
<p>To maximize the write performance of flash memory media, such as SDC, CFC and U Disk, it must be controlled in consideration of its characteristitcs.</p>
|
||||
<h4>Using Mutiple-Sector Write</h4>
|
||||
<div class="rset">
|
||||
Figure 6. Comparison between Multiple/Single Sector Write<br>
|
||||
<img src="../res/f6.png" width="630" height="148" alt="fig.6">
|
||||
</div>
|
||||
<p>The write throughput of the flash memory media becomes the worst at single sector write transaction. The write throughput increases as the number of sectors per a write transaction as shown in Figure 6. This effect more appers at faster interface speed and the performance ratio often becomes grater than ten. <a href="../res/rwtest2.png">This result</a> is clearly explaining how fast is multiple block write (W:16K, 32 sectors) than single block write (W:100, 1 sector), and also larger card tends to be slow at single block write. Number of write transactions also affects life time of the flash memory media. When compared at same amount of write data, the single sector write in Figure 6 above wears flash memory media 16 times more than multiple sector write in Figure 6 below. Single sector write is pretty pain for the flash memory media.</p>
|
||||
<p>Therefore the application program should write the data in large block as possible. The ideal write chunk size and alighment is size of sector, and size of cluster is the best. Of course all layers between the application and the storage device must have consideration on multiple sector write, however most of open-source memory card drivers lack it. Do not split a multiple sector write request into single sector write transactions or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write operation. </p>
|
||||
<h4>Forcing Memory Erase</h4>
|
||||
<p>When remove a file with <tt>f_unlink</tt> function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as 'live block'. If the file data can be erased on removing the file, those data blocks will be turned into the free block pool. This may skip internal block erase operation to the data block on next write operation. As the result the write performance might be improved. FatFs can manage this function by setting <tt><a href="config.html#use_trim">FF_USE_TRIM</a></tt> to 1. Note that because this effect is from an expectation of internal process of the storage device, it is not that always effective. Most applications will not need this function. Also <tt>f_unlink</tt> function can take a time when remove a large file.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="critical">
|
||||
<h3>Critical Section</h3>
|
||||
<p>If a write operation to the FAT volume is interrupted due to an accidental failure, such as sudden blackout, wrong media removal and unrecoverable disk error, the FAT structure on the volume can be broken. Following images shows the critical section of the FatFs module.</p>
|
||||
<div class="lset">
|
||||
Figure 4. Long critical section<br>
|
||||
<img src="../res/f4.png" width="320" height="436" alt="fig.4">
|
||||
</div>
|
||||
<div class="lset">
|
||||
Figure 5. Minimized critical section<br>
|
||||
<img src="../res/f5.png" width="320" height="436" alt="fig.5">
|
||||
</div>
|
||||
<br class="clr">
|
||||
<p>An interruption in the red section can cause a cross link; as a result, the object being changed can be lost. If an interruption in the yellow section is occured, there is one or more possibility listed below.</p>
|
||||
<ul>
|
||||
<li>The file data being rewrited is collapsed.</li>
|
||||
<li>The file being appended returns initial state.</li>
|
||||
<li>The file created as new is gone.</li>
|
||||
<li>The file created as new or overwritten remains but no content.</li>
|
||||
<li>Efficiency of disk use gets worse due to lost clusters.</li>
|
||||
</ul>
|
||||
<p>Each case does not affect any file not opened in write mode. To minimize risk of data loss, the critical section can be minimized by minimizing the time that file is opened in write mode or using <tt>f_sync</tt> function as shown in Figure 5.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="fs3">
|
||||
<h3>Various Usable Functions for FatFs Projects</h3>
|
||||
<p>These are examples of extended use of FatFs APIs. New item will be added when useful code example is found.</p>
|
||||
<ol>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app1.c">Open or Create File for Append</a> (superseded by FA_OPEN_APPEND flag added at R0.12)</li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app2.c">Delete Non-empty Sub-directory</a> (for R0.12 and later)</li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app3.c">Create Contiguous File</a> (superseded by f_expand function added at R0.12)</li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app5.c">Test if the File is Contiguous or Not</a></li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app4.c">Compatibility Checker for Storage Device Control Module</a></li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/app6.c">Performance Checker for Storage Device Control Module</a></li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/mkfatimg.zip">FAT Volume Image Creator</a> (Pre-creating built-in FAT volume)</li>
|
||||
<li>Virtual Drive Feature (refer to lpc176x/ in <a href="../ffsample.zip">ffsample.zip</a>)</li>
|
||||
<li><a href="http://elm-chan.org/fsw/ff/res/uniconv.zip">Embedded Unicode String Utilities</a> (OEMxxx→Unicode, Unicode→OEMxxx, Unicode→Unicode)</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="license">
|
||||
<h3>About FatFs License</h3>
|
||||
<p>FatFs has being developped as a personal project of the author, ChaN. It is free from the code anyone else wrote at current release. Following code block shows a copy of the FatFs license document that included in the source files.</p>
|
||||
<pre>
|
||||
/*----------------------------------------------------------------------------/
|
||||
/ FatFs - Generic FAT Filesystem Module Rx.xx /
|
||||
/-----------------------------------------------------------------------------/
|
||||
/
|
||||
/ Copyright (C) 20xx, ChaN, all right reserved.
|
||||
/
|
||||
/ FatFs module is an open source software. Redistribution and use of FatFs in
|
||||
/ source and binary forms, with or without modification, are permitted provided
|
||||
/ that the following condition is met:
|
||||
/
|
||||
/ 1. Redistributions of source code must retain the above copyright notice,
|
||||
/ this condition and the following disclaimer.
|
||||
/
|
||||
/ This software is provided by the copyright holder and contributors "AS IS"
|
||||
/ and any warranties related to this software are DISCLAIMED.
|
||||
/ The copyright owner or contributors be NOT LIABLE for any damages caused
|
||||
/ by use of this software.
|
||||
/----------------------------------------------------------------------------*/
|
||||
</pre>
|
||||
<p>Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. FatFs is mainly intended for embedded systems. In order to extend the usability for commercial products, the redistributions of FatFs in binary form, such as embedded code, binary library and any forms without source code, does not need to include about FatFs in the documentations. This is equivalent to the 1-clause BSD license. Of course FatFs is compatible with the most of open source software licenses includes GNU GPL. When you redistribute the FatFs source code with any changes or create a fork, the license can also be changed to GNU GPL, BSD-style license or any open source software license that compatible with FatFs license.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chdir.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_chdir</title>
|
||||
</head>
|
||||
@@ -50,8 +48,8 @@ FRESULT f_chdir (
|
||||
|
||||
<div class="para desc">
|
||||
<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>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>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 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>
|
||||
|
||||
|
||||
@@ -64,16 +62,16 @@ FRESULT f_chdir (
|
||||
<div class="para use">
|
||||
<h4>Example</h4>
|
||||
<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");
|
||||
|
||||
<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:..");
|
||||
|
||||
<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");
|
||||
|
||||
<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");
|
||||
</pre>
|
||||
</div>
|
||||
@@ -83,6 +81,7 @@ FRESULT f_chdir (
|
||||
<p><tt><a href="chdrive.html">f_chdrive</a>, <a href="getcwd.html">f_getcwd</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chdrive.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_chdrive</title>
|
||||
</head>
|
||||
@@ -65,6 +63,7 @@ FRESULT f_chdrive (
|
||||
<p><tt><a href="chdir.html">f_chdir</a>, <a href="getcwd.html">f_getcwd</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/chmod.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_chmod</title>
|
||||
</head>
|
||||
@@ -27,7 +25,7 @@ FRESULT f_chmod (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed</dd>
|
||||
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>attr</dt>
|
||||
<dd>Attribute flags to be set in one or more combination of the following flags. The specified flags are set and others are cleard.<br>
|
||||
<table class="lst">
|
||||
@@ -84,6 +82,7 @@ FRESULT f_chmod (
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/close.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_close</title>
|
||||
</head>
|
||||
@@ -60,6 +58,7 @@ FRESULT f_close (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="sync.html">f_sync</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/close.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_closedir</title>
|
||||
</head>
|
||||
@@ -59,6 +57,7 @@ FRESULT f_closedir (
|
||||
<p><tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</a>, <a href="sdir.html">DIR</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+33
-25
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/config.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - Configuration Options</title>
|
||||
</head>
|
||||
@@ -37,7 +35,8 @@
|
||||
<li><a href="#max_lfn">FF_MAX_LFN</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="#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>
|
||||
</li>
|
||||
<li>Volume/Drive Configurations
|
||||
@@ -58,6 +57,7 @@
|
||||
<li><a href="#fs_exfat">FF_FS_EXFAT</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="#fs_ctime">FF_FS_CRTIME</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_reentrant">FF_FS_REENTRANT</a></li>
|
||||
@@ -105,29 +105,29 @@
|
||||
<p>Disable (0) or Enable (1) <tt>f_forward</tt> function.</p>
|
||||
|
||||
<h4 id="use_strfunc">FF_USE_STRFUNC</h4>
|
||||
<p>This option switches string functions, <tt>f_gets</tt>, <tt>f_putc</tt>, <tt>f_puts</tt> and <tt>f_printf</tt>. These functions are equivalents of regular string stream I/O functions in POSIX. If <tt>sprintf</tt> is available and code conversion is not needed, <tt>f_write</tt> with <tt>sprintf</tt> will be efficient in code size and performance rather than <tt>f_printf</tt>. When enable this feature, <tt>stdarg.h</tt> is included in <tt>ff.c</tt>.</p>
|
||||
<p>This option switches string I/O functions, <tt>f_gets</tt>, <tt>f_putc</tt>, <tt>f_puts</tt> and <tt>f_printf</tt>. These functions are the equivalents of regular string stream I/O functions in POSIX. If <tt>sprintf</tt> is available and code conversion is not needed, <tt>f_write</tt> with <tt>sprintf</tt> will be efficient in code size and performance better than <tt>f_printf</tt>. When enable this feature, <tt>stdarg.h</tt> is included in <tt>ff.c</tt>.</p>
|
||||
<table class="lst1">
|
||||
<tr><th>Value</th><th>Description</th></tr>
|
||||
<tr><td>0</td><td>Disable string functions.</td></tr>
|
||||
<tr><td>1</td><td>Enable string functions without LF-CRLF conversion.</td></tr>
|
||||
<tr><td>2</td><td>Enable string functions with LF-CRLF conversion.</td></tr>
|
||||
<tr><td>1</td><td>Enable string functions without LF - CRLF conversion.</td></tr>
|
||||
<tr><td>2</td><td>Enable string functions with LF - CRLF conversion.</td></tr>
|
||||
</table>
|
||||
|
||||
<h4 id="print_lli">FF_PRINT_LLI</h4>
|
||||
<p>This option switches support for long long integer argument in <tt>f_printf</tt>.</p>
|
||||
<p>Disable (0) or Enable (1). When enable this feature, C standard needs to be C99 or later.</p>
|
||||
<p>Disable (0) or Enable (1). When enable this feature, C standard needs to be C99 or later. This option has no effect when <tt>FF_USE_STRFUNC == 0</tt>.</p>
|
||||
|
||||
<h4 id="print_fp">FF_PRINT_FLOAT</h4>
|
||||
<p>This option switches support for floating point argument in <tt>f_printf</tt>. When enable this feature, C standard needs to be C99 or later and <tt>math.h</tt> is included in <tt>ff.c</tt>.</p>
|
||||
<p>This option switches support for floating point argument in <tt>f_printf</tt>. When enable this feature, C standard needs to be C99 or later and <tt>math.h</tt> is included in <tt>ff.c</tt>. This option has no effect when <tt>FF_USE_STRFUNC == 0</tt>.</p>
|
||||
<table class="lst1">
|
||||
<tr><th>Value</th><th>Description</th></tr>
|
||||
<tr><td>0</td><td>Disable floating point argument.</td></tr>
|
||||
<tr><td>1</td><td>Enable floating point argument in type <tt>'f'</tt>, <tt>'e'</tt> and <tt>'E'</tt>.</td></tr>
|
||||
<tr><td>2</td><td>Enable it with decimal separator <tt>','</tt> instead of <tt>'.'</tt>.</td></tr>
|
||||
<tr><td>2</td><td>Same as 1 but with decimal separator <tt>','</tt> instead of <tt>'.'</tt> in output string.</td></tr>
|
||||
</table>
|
||||
|
||||
<h4 id="strf_encode">FF_STRF_ENCODE</h4>
|
||||
<p>When character encoding on the API is Unicode (<tt>FF_LFN_UNICODE >= 1</tt>), string I/O functions enabled by <tt>FF_USE_STRFUNC</tt> convert the character encoding in it. This option defines the assumption of character encoding <em>on the file</em> to be read/written via those functions. When LFN is not enabled or <tt>FF_LFN_UNICODE == 0</tt>, the string functions work without any code conversion and this option has no effect.</p>
|
||||
<p>When the character encoding on the API is Unicode (<tt>FF_LFN_UNICODE >= 1</tt>), string I/O functions enabled by <tt>FF_USE_STRFUNC</tt> convert the character encoding in it. This option defines the assumption of character encoding <em>on the file</em> to be read/written via the string I/O functions. When LFN is not enabled or <tt>FF_LFN_UNICODE == 0</tt>, the string I/O functions work without any code conversion and this option has no effect.</p>
|
||||
<table class="lst2">
|
||||
<tr><th>Value</th><th>Character encoding on the file</th></tr>
|
||||
<tr><td>0</td><td>ANSI/OEM in current code page</td></tr>
|
||||
@@ -171,7 +171,7 @@
|
||||
</table>
|
||||
|
||||
<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">
|
||||
<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>
|
||||
@@ -181,7 +181,7 @@
|
||||
</table>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
@@ -192,7 +192,7 @@
|
||||
<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>
|
||||
</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>
|
||||
|
||||
<h4 id="lfn_buf">FF_LFN_BUF, FF_SFN_BUF</h4>
|
||||
@@ -204,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-8</td><td>765 items</td><td>34 items</td></tr>
|
||||
</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>
|
||||
<p>This option configures relative path function. For more information, read <a href="filename.html#nam">here</a>.</p>
|
||||
<h4 id="fs_rpath">FF_RPATH</h4>
|
||||
<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">
|
||||
<tr><th>Value</th><th>Description</th></tr>
|
||||
<tr><td>0</td><td>Disable relative path and remove related functions.</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>2</td><td><tt>f_getcwd</tt> function is available in addition to 1</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> are available.</td></tr>
|
||||
<tr><td>2</td><td><tt>f_getcwd</tt> is available in addition.</td></tr>
|
||||
</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>
|
||||
|
||||
|
||||
@@ -225,12 +229,12 @@
|
||||
<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>
|
||||
<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">
|
||||
<tr><th>Value</th><th>Description</th><th>Example</th></tr>
|
||||
<tr><td>0</td><td>Only DOS/Windows style drive prefix in numeric ID can be used.</td><td>1:/filename</td></tr>
|
||||
<tr><td>1</td><td>Also DOS/Windows style drive prefix in string ID can be used.</td><td>flash:/filename</td></tr>
|
||||
<tr><td>2</td><td>Also Unix style drive prefix in string ID can be used.</td><td>/flash/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><em>flash:</em>/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>
|
||||
|
||||
<h4 id="volume_strs">FF_VOLUME_STRS</h4>
|
||||
@@ -241,7 +245,7 @@ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb"};
|
||||
</pre>
|
||||
|
||||
<h4 id="multi_partition">FF_MULTI_PARTITION</h4>
|
||||
<p>Disable (0) or Enable (1). This option switches multi-partition function. By default (0), each logical drive number is bound to the same physical drive number and only a volume in the physical drive is mounted. When enabled, each logical drive is bound to the partition on the physical drive listed in the user defined partition resolution table <tt>VolToPart[]</tt>. Also <tt>f_fdisk</tt> funciton will be available. For more information, read <a href="filename.html#vol">here</a>.</p>
|
||||
<p>This option switches multi-partition featuer. By default (0), each logical drive number is bound to the same physical drive number and only one volume found in the physical drive is mounted. When it is enabled (1), each logical drive is bound to the specific partition listed in the user defined partition resolution table <tt>VolToPart[]</tt>. Also <tt>f_fdisk</tt> funciton is available to create the arbitrary partitions on the physical drive. For more information, read <a href="filename.html#vol">here</a>.</p>
|
||||
|
||||
<h4 id="max_ss">FF_MIN_SS, FF_MAX_SS</h4>
|
||||
<p>This set of options defines the extent of sector size used for the low level disk I/O interface, <tt>disk_read</tt> and <tt>disk_write</tt> function. Valid values are 512, 1024, 2048 and 4096. <tt>FF_MIN_SS</tt> defines minimum sector size and <tt>FF_MAX_SS</tt> defines the maximum sector size. Always set both 512 for memory card and harddisk. But a larger value may be required for on-board flash memory and some type of optical media. When <tt>FF_MAX_SS > FF_MIN_SS</tt>, support of variable sector size is enabled and <tt>GET_SECTOR_SIZE</tt> command needs to be implemented to the <tt>disk_ioctl</tt> function.</p>
|
||||
@@ -273,6 +277,9 @@ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb"};
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<h4 id="fs_nofsinfo">FF_FS_NOFSINFO</h4>
|
||||
<p>0 to 3. If you need to know correct free space on the FAT32 volume, set bit 0 of this option, and <tt>f_getfree</tt> function at first time after the volume mounted will force a full FAT scan. Bit 1 controls the use of last allocated cluster number for new allocation.</p>
|
||||
<table class="lst1">
|
||||
@@ -299,6 +306,7 @@ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb"};
|
||||
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dinit.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_initialize</title>
|
||||
</head>
|
||||
@@ -41,6 +39,7 @@ DSTATUS disk_initialize (
|
||||
<p><em>Remarks: This function needs to be under control of FatFs module. Application program MUST NOT call this function while FatFs is in use, or FAT structure on the volume can be broken. To re-initialize the filesystem, use <tt>f_mount</tt> function instead.</em></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dioctl.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_ioctl</title>
|
||||
</head>
|
||||
@@ -58,9 +56,9 @@ DRESULT disk_ioctl (
|
||||
<caption>Standard ioctl command used by FatFs</caption>
|
||||
<tr><th>Command</th><th>Description</th></tr>
|
||||
<tr><td>CTRL_SYNC</td><td>Makes sure that the device has finished pending write process. If the disk I/O layer or storage device has a write-back cache, the dirty cache data must be committed to the medium immediately. Nothing to do for this command if each write operation to the medium is completed in the <tt>disk_write</tt> function.</td></tr>
|
||||
<tr><td>GET_SECTOR_COUNT</td><td>Retrieves number of available sectors, the largest allowable LBA + 1, on the drive into the <tt>LBA_t</tt> variable that pointed by <tt class="arg">buff</tt>. This command is used by <tt>f_mkfs</tt> and <tt>f_fdisk</tt> function to determine the size of volume/partition to be created. It is required when <tt>FF_USE_MKFS == 1</tt>.</td></tr>
|
||||
<tr><td>GET_SECTOR_SIZE</td><td>Retrieves sector size, minimum data unit for generic read/write, into the <tt>WORD</tt> variable that pointed by <tt class="arg">buff</tt>. Valid sector sizes are 512, 1024, 2048 and 4096. This command is required only if <tt>FF_MAX_SS > FF_MIN_SS</tt>. When <tt>FF_MAX_SS == FF_MIN_SS</tt>, this command will be never used and the read/write function must work in <tt>FF_MAX_SS</tt> bytes/sector.</td></tr>
|
||||
<tr><td>GET_BLOCK_SIZE</td><td>Retrieves <em>erase block size in unit of sector</em> of the flash memory media into the <tt>DWORD</tt> variable that pointed by <tt class="arg">buff</tt>. The allowable value is 1 to 32768 in power of 2. Return 1 if the value is unknown or non flash memory media. This command is used by only <tt>f_mkfs</tt> function and it attempts to align data area on the suggested block boundary. It is required when <tt>FF_USE_MKFS == 1</tt>. Note that FatFs does not have FTL (flash translation layer). Either disk I/O layter or storage device must have an FTL in it.</td></tr>
|
||||
<tr><td>GET_SECTOR_COUNT</td><td>Retrieves number of available sectors (the largest allowable LBA + 1) on the drive into the <tt>LBA_t</tt> variable that pointed by <tt class="arg">buff</tt>. This command is used by <tt>f_mkfs</tt> and <tt>f_fdisk</tt> function to determine the size of volume/partition to be created.</td></tr>
|
||||
<tr><td>GET_SECTOR_SIZE</td><td>Retrieves sector size (minimum data unit for generic read/write) into the <tt>WORD</tt> variable that pointed by <tt class="arg">buff</tt>. Valid sector sizes are 512, 1024, 2048 and 4096. This command is required only if <tt>FF_MAX_SS > FF_MIN_SS</tt>. When <tt>FF_MAX_SS == FF_MIN_SS</tt>, this command will never be used and the <tt>disk_read</tt> and <tt>disk_write</tt> function must work in <tt>FF_MAX_SS</tt> bytes/sector.</td></tr>
|
||||
<tr><td>GET_BLOCK_SIZE</td><td>Retrieves <em>erase block size in unit of sector</em> of the flash memory media into the <tt>DWORD</tt> variable that pointed by <tt class="arg">buff</tt>. The allowable value is 1 to 32768 in power of 2. Return 1 if it is unknown or in non flash memory media. This command is used by <tt>f_mkfs</tt> function with block size not specified and it attempts to align the data area on the suggested block boundary. Note that FatFs does not have FTL (flash translation layer), so that either disk I/O layter or storage device must have an FTL in it.</td></tr>
|
||||
<tr><td>CTRL_TRIM</td><td>Informs the disk I/O layter or the storage device that the data on the block of sectors is no longer needed and it can be erased. The sector block is specified in an <tt>LBA_t</tt> array <tt>{<Start LBA>, <End LBA>}</tt> that pointed by <tt class="arg">buff</tt>. This is an identical command to Trim of ATA device. Nothing to do for this command if this funcion is not supported or not a flash memory device. FatFs does not check the result code and the file function is not affected even if the sector block was not erased well. This command is called on remove a cluster chain and in the <tt>f_mkfs</tt> function. It is required when <tt>FF_USE_TRIM == 1</tt>.</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -96,6 +94,6 @@ DRESULT disk_ioctl (
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dread.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_read</title>
|
||||
</head>
|
||||
@@ -68,6 +66,6 @@ DRESULT disk_read (
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dstat.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_status</title>
|
||||
</head>
|
||||
@@ -43,6 +41,7 @@ DSTATUS disk_status (
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dwrite.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - disk_write</title>
|
||||
</head>
|
||||
@@ -60,7 +58,7 @@ DRESULT disk_write (
|
||||
<h4>Description</h4>
|
||||
<p>The specified memory address is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. For more information, refer to the description of <a href="dread.html"><tt>disk_read</tt></a> function.</p>
|
||||
<p>Generally, a multiple sector write request (<tt class="arg">count</tt><tt> > 1</tt>) must not be split into single sector transactions to the storage device, or the file write throughput will be drastically decreased.</p>
|
||||
<p>FatFs expects delayed write function of the disk control layer. The write operation to the media does not need to be completed when return from this function by what write operation is in progress or data is only stored into the write-back cache. But write data on the <tt class="arg">buff</tt> is invalid after return from this function. The write completion request is done by <tt>CTRL_SYNC</tt> command of <tt><a href="dioctl.html">disk_ioctl</a></tt> function. Therefore, if a delayed write function is implemented, the write throughput of the filesystem will be improved.</p>
|
||||
<p>FatFs expects the disk control layer may have a delayed write feature. The write operation to the media does not need to be completed when return from this function by what media write operation is in progress or data is stored into the write-back cache. The write data on the <tt class="arg">buff</tt> is invalid after return from this function. The write completion request is done by <tt>CTRL_SYNC</tt> command of <tt><a href="dioctl.html">disk_ioctl</a></tt> function. Therefore, if a delayed write feature is implemented, the write throughput of the filesystem will be improved.</p>
|
||||
<p><em>Remarks: Application program MUST NOT call this function, or FAT structure on the volume can be collapsed.</em></p>
|
||||
</div>
|
||||
|
||||
@@ -71,6 +69,6 @@ DRESULT disk_write (
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/eof.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_eof</title>
|
||||
</head>
|
||||
@@ -57,6 +55,7 @@ int f_eof (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/error.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_error</title>
|
||||
</head>
|
||||
@@ -57,6 +55,7 @@ int f_error (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/lseek.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_expand</title>
|
||||
</head>
|
||||
@@ -28,7 +26,7 @@ FRESULT f_expand (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the open file object.</dd>
|
||||
<dd>Pointer to the open file object. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>fsz</dt>
|
||||
<dd>Number of bytes in size to prepare or allocate for the file. The data type <tt>FSIZE_t</tt> is an alias of either <tt>DWORD</tt>(32-bit) or <tt>QWORD</tt>(64-bit) depends on the configuration option <tt>FF_FS_EXFAT</tt>.</dd>
|
||||
<dt>opt</dt>
|
||||
@@ -61,7 +59,7 @@ FRESULT f_expand (
|
||||
</ul>
|
||||
<p>When <tt class="arg">opt</tt> is 0, the function finds a contiguous data area and set it as suggested point for next allocation. The subsequent cluster allocation begins at top of the contiguous area found by this function. Thus the file allocation is guaranteed be contiguous and without allocation delay until the file size reaches this size unless any other changes to the volume is performed.</p>
|
||||
<p>The contiguous file has an advantage for time-critical read/write operations. It eliminates some overheads in the filesystem and the storage device caused by random access for fragmented file.</p>
|
||||
<p>Also the contiguous file can be easily accessed directly via low-level disk functions. However, this is not recommended in consideration of portability and future compatibility. If the file has not been confirmed be contiguous, use <a href="../res/app5.c">this function</a> to examine if the file is contiguous or not.</p>
|
||||
<p>The contiguou files can easily be accessed via low-level disk functions. However, this is not recommended in consideration of portability and future compatibility. If the file has not been confirmed be contiguous, use <a href="../res/app5.c">this function</a> to examine if the file is contiguous or not.</p>
|
||||
</div>
|
||||
|
||||
<div class="para comp">
|
||||
@@ -76,16 +74,16 @@ FRESULT f_expand (
|
||||
<span class="c">/* Creating a contiguous file */</span>
|
||||
|
||||
<span class="c">/* Create a new file */</span>
|
||||
res = f_open(fp = malloc(sizeof (FIL)), "file.dat", FA_WRITE|FA_CREATE_ALWAYS);
|
||||
res = <em>f_open</em>(fp = malloc(sizeof (FIL)), "file.dat", FA_WRITE|FA_CREATE_ALWAYS);
|
||||
if (res) { <span class="c">/* Check if the file has been opened */</span>
|
||||
free(fp);
|
||||
die("Failed to open the file.");
|
||||
}
|
||||
|
||||
<span class="c">/* Alloacte a 100 MiB of contiguous area to the file */</span>
|
||||
<span class="c">/* Allocate a 100 MiB of contiguous area to the file */</span>
|
||||
res = <em>f_expand</em>(fp, 104857600, 1);
|
||||
if (res) { <span class="c">/* Check if the file has been expanded */</span>
|
||||
f_close(fp);
|
||||
<em>f_close</em>(fp);
|
||||
free(fp);
|
||||
die("Failed to allocate contiguous area.");
|
||||
}
|
||||
@@ -101,7 +99,7 @@ FRESULT f_expand (
|
||||
lba = fp->obj.fs->database + fp->obj.fs->csize * (fp->obj.sclust - 2);
|
||||
|
||||
<span class="c">/* Write 2048 sectors from top of the file at a time */</span>
|
||||
res = disk_write(drv, buffer, lba, 2048);
|
||||
res = <em>disk_write</em>(drv, data, lba, 2048);
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
@@ -112,6 +110,7 @@ FRESULT f_expand (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/fattime.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - get_fattime</title>
|
||||
</head>
|
||||
@@ -75,6 +73,6 @@ DWORD get_fattime (void)
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+11
-12
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/fdisk.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_fdisk</title>
|
||||
</head>
|
||||
@@ -49,7 +47,7 @@ FRESULT f_fdisk (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The <tt>f_fdisk</tt> function creates partitions on the physical drive. The partitioning format can be in generic MBR or GPT. The partition map table specifies how to divide the physical drive. The first item specifies the size of the first partition and the partitions are located on the drive in order of from the first item. When the value of item is less than or equal to 100, it specifies the partition size in percentage of the entire drive space. When it is larger than 100, it specifies number of sectors. The partition map table is terminated by a zero, no space is remaining for next allocation or 4th partition is created in MBR format. If the specified size is larger than remaining space on the drive, the partition is truncated at end of the drive.</p>
|
||||
<p>The <tt>f_fdisk</tt> function creates partitions on the physical drive. The partitioning format can be in generic MBR or GPT. The partition map table specifies how to divide the physical drive. The first item specifies the size of the first partition and the partitions are located on the drive in order of from the first item. When the value of item is less than or equal to 100, it specifies the partition size in percentage of the entire drive space. When it is larger than 100, it specifies number of sectors. The partition map table is terminated by a zero, 4th partition in MBR format or no remainin space for next allocation. If the specified size is larger than remaining space on the drive, the partition is truncated at end of the drive.</p>
|
||||
<p>By default, partitions are created in MBR format. It can create upto four primary partitions on a drive. GPT format is used to create the partitions when 64-bit LBA is enabled (<tt>FF_LBA64 = 1</tt>) and the drive size is equal to or larger than <tt><a href="config.html#fs_gptmin">FF_MIN_GPT</a></tt> sectors. It can create over ten partitions on a drive.</p>
|
||||
</div>
|
||||
|
||||
@@ -64,23 +62,23 @@ FRESULT f_fdisk (
|
||||
<span class="c">/* Volume mapping table defined by user (required when FF_MULTI_PARTITION == 1) */</span>
|
||||
|
||||
PARTITION VolToPart[FF_VOLUMES] = {
|
||||
{0, 1}, <span class="c">/* "0:" ==> 1st partition in PD#0 */</span>
|
||||
{0, 2}, <span class="c">/* "1:" ==> 2nd partition in PD#0 */</span>
|
||||
{1, 0} <span class="c">/* "2:" ==> PD#1 as removable drive */</span>
|
||||
{0, 1}, <span class="c">/* "0:" ==> 1st partition in physical drive 0 */</span>
|
||||
{0, 2}, <span class="c">/* "1:" ==> 2nd partition in physical drive 0 */</span>
|
||||
{1, 0} <span class="c">/* "2:" ==> Physical drive 1 as removable drive */</span>
|
||||
};
|
||||
</pre>
|
||||
<pre>
|
||||
<span class="c">/* Initialize a brand-new disk drive mapped to physical drive 0 */</span>
|
||||
|
||||
BYTE work[FF_MAX_SS]; <span class="c">/* Working buffer */</span>
|
||||
LBA_t plist[] = {50, 50, 0}; <span class="c">/* Divide the drive into two partitions */</span>
|
||||
<span class="c">/* {0x10000000, 100}; 256M sectors for 1st partition and left all for 2nd partition */</span>
|
||||
LBA_t plist[] = {50, 50, 0}; <span class="c">/* Divide the drive by 2 */</span>
|
||||
<span class="c">/* {0x10000000, 100}; 256M sectors for the 1st partition and the remaining for the 2nd partition */</span>
|
||||
<span class="c">/* {20, 20, 20, 0}; 20% for 3 partitions each and remaing space is left not allocated */</span>
|
||||
|
||||
<em>f_fdisk</em>(0, plist, work); <span class="c">/* Divide physical drive 0 */</span>
|
||||
<em>f_fdisk</em>(0, plist, work); <span class="c">/* Divide the physical drive 0 */</span>
|
||||
|
||||
f_mkfs("0:", 0, work, sizeof work); <span class="c">/* Create FAT volume on the logical drive 0 */</span>
|
||||
f_mkfs("1:", 0, work, sizeof work); <span class="c">/* Create FAT volume on the logical drive 1 */</span>
|
||||
<em>f_mkfs</em>("0:", 0, work, sizeof work); <span class="c">/* Create FAT volume on the logical drive 0 */</span>
|
||||
<em>f_mkfs</em>("1:", 0, work, sizeof work); <span class="c">/* Create FAT volume on the logical drive 1 */</span>
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
@@ -90,6 +88,7 @@ FRESULT f_fdisk (
|
||||
<p><a href="filename.html#vol">Volume management</a>, <a href="mkfs.html"><tt>f_mkfs</tt></a></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+17
-22
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/filename.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - Path Names</title>
|
||||
</head>
|
||||
@@ -14,12 +12,12 @@
|
||||
|
||||
<div class="para doc" id="nam">
|
||||
<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>
|
||||
<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> >= 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>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>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>When relative path feature is enabled (<tt>FF_FS_RPATH >= 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>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> >= 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 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 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 >= 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">
|
||||
<tr><td>Path name</td><td>FF_FS_RPATH == 0</td><td>FF_FS_RPATH >= 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>
|
||||
@@ -29,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 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>../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>Parent directory of the current directory (*)</td></tr>
|
||||
<tr><td>dir1/..</td><td>Invalid name</td><td>The current directory</td></tr>
|
||||
<tr><td>..</td><td>Invalid name</td><td>Parent 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>
|
||||
</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>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 start of drive prefix and in absolute path. Any form as "root directory in current drive" and "current directory in specified drive" cannot be used. Double dot name cannot traverse the drives 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>
|
||||
<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 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>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="case">
|
||||
<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 ! # $ % & ' ( ) - @ ^ _ ` { } ~</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 name on the FAT volume is 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 raw name is recorded to the LFN entry when LFN extension is exist.</p>
|
||||
<p>As for the MS-DOS and PC DOS for CJK (DOS/DBCS), extended characters ware 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>In the generic FAT filesystems, the legal characters for the object (file or sub-directory) name are, <tt>0-9 A-Z ! # $ % & ' ( ) - @ ^ _ ` { } ~</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 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 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 class="para doc" id="uni">
|
||||
@@ -73,10 +69,8 @@ PARTITION VolToPart[FF_VOLUMES] = {
|
||||
{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>
|
||||
};
|
||||
|
||||
|
||||
<img src="../res/f7.png" width="900" height="288" alt="relationship between logical drive and physical drive">
|
||||
</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>
|
||||
<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>
|
||||
@@ -84,11 +78,12 @@ PARTITION VolToPart[FF_VOLUMES] = {
|
||||
<li>On the MBR format drive, up to four primary partitions (1-4) can be specified. The partition number 1 specifies the first item in the partition table and the partition number 2 specifies the second one, and so on. The logical patitions (5-) in the extended partition is not supported.</li>
|
||||
<li>On the GPT format drive, the partition number 1 specifies the first Microsoft BDP found in the partition table and the partition number 2 specifies the second one found, and so on.</li>
|
||||
<li>Windows 10 earlier than 1703 does not support multiple volumes on the physical drive with removable class. Only the first parition found on the drive will be mounted. Windows OS does not support SFD format on the physical drive with non-removable class.</li>
|
||||
<li>Some systems manage the on-board storage in non-standard partition format and each partition is mapped as physical drive in <tt>disk_*</tt> functions. For such system, <tt>FF_MULTI_PARTITION</tt> should be always 0.</li>
|
||||
<li>For further information about the volume management, refer to the description in <tt><a href="fdisk.html">f_fdisk</a></tt> and <tt><a href="mkfs.html">f_mkfs</a></tt>.</li>
|
||||
<li>Some systems manage the on-board storage in non-standard partition format and each partition is mapped as physical drive in <tt>disk_*</tt> functions. For such system, <tt>FF_MULTI_PARTITION</tt> should be always 0 and use <tt>FM_SFD</tt> flag in <tt><a href="mkfs.html">f_mkfs</a></tt>.</li>
|
||||
<li>For further information about the volume management, refer to the description in <tt>f_mkfs</tt> and <tt><a href="fdisk.html">f_fdisk</a></tt>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/findfirst.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_findfirst</title>
|
||||
</head>
|
||||
@@ -28,7 +26,7 @@ FRESULT f_findfirst (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>dp</dt>
|
||||
<dd>Pointer to the blank directory object.</dd>
|
||||
<dd>Pointer to the blank directory object. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>fno</dt>
|
||||
<dd>Pointer to the <a href="sfileinfo.html">file information structure</a> to store the information about the found item.</dd>
|
||||
<dt>path</dt>
|
||||
@@ -69,10 +67,10 @@ FRESULT f_findfirst (
|
||||
<li><tt>*</tt> - An any string in length of zero or longer.</li>
|
||||
<li><tt>????*</tt> - An any string in length of four characters or longer.</li>
|
||||
</ul>
|
||||
<p>Since the matching algorithm uses recursion, number of wildcards in the matching pattern is limited to four to limit the stack usage. Any pattern with too many wildcards does not match any name. In LFN configuration, only <tt>fname[]</tt> is tested when <tt>FF_USE_FIND == 1</tt> and also <tt>altname[]</tt> is tested when <tt>FF_USE_FIND == 2</tt>. There are some differences listed below between FatFs and standard systems in matching condition.</p>
|
||||
<p>Since the matching algorithm uses recursion, number of wildcards in the matching pattern is limited to four to limit the stack usage. The pattern with too many wildcards does not match any name. In LFN configuration, only <tt>fname[]</tt> is tested when <tt>FF_USE_FIND == 1</tt> and also <tt>altname[]</tt> is tested when <tt>FF_USE_FIND == 2</tt>. There are some differences listed below between FatFs and standard systems in matching condition.</p>
|
||||
<ul>
|
||||
<li><tt>"*.*"</tt> does not match any name without extension while it matches any name with or without extension in standard systems.</li>
|
||||
<li>Any pattern terminated with a dot does not match any name while it matches the name without extensiton in standard systems.</li>
|
||||
<li>The pattern terminated with a dot does not match any name while it matches the name without extensiton in standard systems.</li>
|
||||
<li><a href="filename.html#case">DBCS extended characters</a> are compared in case-sensitive when LFN is enabled with <tt>!FF_LFN_UNICODE</tt>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -99,10 +97,10 @@ void find_image_file (void)
|
||||
|
||||
while (fr == FR_OK && fno.fname[0]) { <span class="c">/* Repeat while an item is found */</span>
|
||||
printf("%s\n", fno.fname); <span class="c">/* Print the object name */</span>
|
||||
fr = f_findnext(&dj, &fno); <span class="c">/* Search for next item */</span>
|
||||
fr = <em>f_findnext</em>(&dj, &fno); <span class="c">/* Search for next item */</span>
|
||||
}
|
||||
|
||||
f_closedir(&dj);
|
||||
<em>f_closedir</em>(&dj);
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
@@ -113,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>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/findnext.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_findnext</title>
|
||||
</head>
|
||||
@@ -64,6 +62,7 @@ FRESULT f_findnext (
|
||||
<p><tt><a href="findfirst.html">f_findfirst</a>, <a href="closedir.html">f_closedir</a>, <a href="sdir.html">DIR</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/forward.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_forward</title>
|
||||
</head>
|
||||
@@ -28,13 +26,13 @@ FRESULT f_forward (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the open file object.</dd>
|
||||
<dd>Pointer to the open file object. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>func</dt>
|
||||
<dd>Pointer to the user-defined data streaming function. For details, refer to the sample code.</dd>
|
||||
<dt>btf</dt>
|
||||
<dd>Number of bytes to forward in range of <tt>UINT</tt>.</dd>
|
||||
<dt>bf</dt>
|
||||
<dd>Pointer to the <tt>UINT</tt> variable to return number of bytes forwarded.</dd>
|
||||
<dd>Pointer to the variable in <tt>UINT</tt> type to return number of bytes forwarded.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -109,11 +107,11 @@ FRESULT play_file (
|
||||
UINT dmy;
|
||||
|
||||
<span class="c">/* Open the audio file in read only mode */</span>
|
||||
rc = f_open(&fil, fn, FA_READ);
|
||||
rc = <em>f_open</em>(&fil, fn, FA_READ);
|
||||
if (rc) return rc;
|
||||
|
||||
<span class="c">/* Repeat until the file pointer reaches end of the file */</span>
|
||||
while (rc == FR_OK && !f_eof(&fil)) {
|
||||
while (rc == FR_OK && !<em>f_eof</em>(&fil)) {
|
||||
|
||||
<span class="c">/* some processes... */</span>
|
||||
|
||||
@@ -122,7 +120,7 @@ FRESULT play_file (
|
||||
}
|
||||
|
||||
<span class="c">/* Close the file and return */</span>
|
||||
f_close(&fil);
|
||||
<em>f_close</em>(&fil);
|
||||
return rc;
|
||||
}
|
||||
</pre>
|
||||
@@ -134,6 +132,7 @@ FRESULT play_file (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getcwd.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_getcwd</title>
|
||||
</head>
|
||||
@@ -13,11 +11,11 @@
|
||||
|
||||
<div class="para func">
|
||||
<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>
|
||||
FRESULT f_getcwd (
|
||||
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>
|
||||
</div>
|
||||
@@ -26,9 +24,9 @@ FRESULT f_getcwd (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -51,7 +49,6 @@ FRESULT f_getcwd (
|
||||
<div class="para desc">
|
||||
<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> >= 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>
|
||||
|
||||
|
||||
@@ -78,6 +75,7 @@ FRESULT f_getcwd (
|
||||
<p><tt><a href="chdrive.html">f_chdrive</a>, <a href="chdir.html">f_chdir</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getfree.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_getfree</title>
|
||||
</head>
|
||||
@@ -89,6 +87,6 @@ FRESULT f_getfree (
|
||||
<p><tt><a href="sfatfs.html">FATFS</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getlabel.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_getlabel</title>
|
||||
</head>
|
||||
@@ -27,7 +25,7 @@ FRESULT f_getlabel (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. Null-string specifies the default drive.</dd>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. Null-string specifies the default drive. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
|
||||
<dt>label</dt>
|
||||
<dd>Pointer to the buffer to store the volume label. If the volume has no label, a null-string will be returned. Set null pointer if this information is not needed. The buffer size should be shown below at least to avoid buffer overflow.<br>
|
||||
<table class="lst2">
|
||||
@@ -85,6 +83,6 @@ FRESULT f_getlabel (
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/gets.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_gets</title>
|
||||
</head>
|
||||
@@ -45,13 +43,13 @@ TCHAR* f_gets (
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The read operation continues until a <tt>'\n'</tt> is stored, reached end of the file or the buffer is filled with <tt>len - 1</tt> characters. The read string is terminated with a <tt>'\0'</tt>. When no character to read or any error occured during read operation, it returns a null pointer. The status of EOF and error can be examined with <tt>f_eof</tt> and <tt>f_error</tt> function.</p>
|
||||
<p>When FatFs is configured to Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), data types on the srting fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt>, is also switched to Unicode. The character encoding <em>on the file</em> to be read via this function is assumed as <a href="config.html#strf_encode"><tt>FF_STRF_ENCODE</tt></a>. If the character encoding on the file differs from that on the API, it is converted in this function. In this case, input characters with wrong encoding will be lost.</p>
|
||||
<p>When FatFs is configured to Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), data types on the srting fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt>, is also switched to Unicode. The character encoding <em>on the file</em> to be read via this function is assumed as <a href="config.html#strf_encode"><tt>FF_STRF_ENCODE</tt></a>. If the character encoding differs between file data and API, it is converted in this function. Input characters with wrong encoding for output will be lost.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para comp">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>This is a wrapper function of <a href="read.html"><tt>f_read</tt></a> function. Available when <tt><a href="config.html#use_strfunc">FF_USE_STRFUNC</a> >= 1</tt>. When it is set to 2, <tt>'\r'</tt>s contained in the file are stripped out.</p>
|
||||
<p>This is a wrapper function of <a href="read.html"><tt>f_read</tt></a> function. Available when <tt><a href="config.html#use_strfunc">FF_USE_STRFUNC</a> >= 1</tt>. When it is set to 2, <tt>'\r'</tt>s contained in the read data are stripped off.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -60,6 +58,7 @@ TCHAR* f_gets (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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>
|
||||
+13
-13
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/lseek.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_lseek</title>
|
||||
</head>
|
||||
@@ -32,7 +30,7 @@ FRESULT f_rewind (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the open file object.</dd>
|
||||
<dd>Pointer to the open file object. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>ofs</dt>
|
||||
<dd>Byte offset from top of the file to set read/write pointer. The data type <tt>FSIZE_t</tt> is an alias of either <tt>DWORD</tt>(32-bit) or <tt>QWORD</tt>(64-bit) depends on the configuration option <tt><a href="config.html#fs_exfat">FF_FS_EXFAT</a></tt>.</dd>
|
||||
</dl>
|
||||
@@ -53,17 +51,18 @@ FRESULT f_rewind (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>File read/write ponter in the open file object points the data byte to be read/written at next read/write operation. It advances as the number of bytes read/written. The <tt>f_lseek</tt> function moves the file read/write pointer without any read/write operation to the file. The <tt>f_rewind</tt> function is impremented as a macro.</p>
|
||||
<p>File read/write ponter in the open file object points the data byte to be read/written at next read/write operation. It advances as the number of bytes read/written. The <tt>f_lseek</tt> function moves the file read/write pointer without read/write operation to the file. The <tt>f_rewind</tt> function is impremented as a macro.</p>
|
||||
<pre>
|
||||
#define <em>f_rewind</em>(fp) f_lseek((fp), 0)
|
||||
</pre>
|
||||
<p>If an offset beyond the file size is specified in write mode, the file size is expanded to the specified offset. The file data in the expanded part is <em>undefined</em>, because no data is written to the file in this process. This is suitable to pre-allocate a data area to the file quickly for fast write operation. When a contiguous data area needs to be allocated to the file, use <tt>f_expand</tt> function instead. After the <tt>f_lseek</tt> function succeeded, the current read/write pointer should be checked in order to make sure the read/write pointer has been moved correctry. In case of the read/write pointer is not pointing expected offset, either of followings has been occured.</p>
|
||||
<p>When an offset beyond the file size is specified in write mode, the file size is expanded to the specified offset <em>in this function</em>. The file data in the expanded part is <em>undefined</em>, because no data is written to the file in this process. Be careful about these behaviours differ from POSIX <tt>fseek</tt> function. This is suitable to pre-allocate a data area to the file for subsequent fast write operation. If a contiguous data area needs to be allocated to the file, use <tt>f_expand</tt> function instead.</p>
|
||||
<p>After the <tt>f_lseek</tt> function succeeded, the current read/write pointer should be checked in order to make sure the read/write pointer has been moved correctry. In case of the read/write pointer is not pointing expected offset, either of followings has been occured.</p>
|
||||
<ul>
|
||||
<li>End of file. The specified <tt class="arg">ofs</tt> was clipped at end of the file in read-only mode.</li>
|
||||
<li>Disk full. There is no free space on the volume to expand the file.</li>
|
||||
</ul>
|
||||
<p>The fast seek feature enables fast backward/long seek operations without FAT access by using an on-memory CLMT (cluster link map table). It is applied to <tt>f_read</tt> and <tt>f_write</tt> function as well, however, the file size cannot be expanded by <tt>f_write</tt>, <tt>f_lseek</tt> function while the file is at fast seek mode.</p>
|
||||
<p>The fast seek mode is available when <tt>FF_USE_FASTSEEK = 1</tt>. The CLMT must be created into the <tt>DWORD</tt> array prior to use the fast seek mode. To create the CLMT, set address of the <tt>DWORD</tt> array to the member <tt>cltbl</tt> in the open file object, set the size of array in unit of items to the <tt>cltbl[0]</tt> and then call <tt>f_lseek</tt> function with <tt class="arg">ofs</tt><tt> = CREATE_LINKMAP</tt>. After the function succeeded, no FAT access is occured in subsequent <tt>f_read</tt>, <tt>f_write</tt>, <tt>f_lseek</tt> function to the file. The number of items used or required is returned into the <tt>cltbl[0]</tt>. The number of items needed is (number of the file fragments + 1) * 2. For example, 12 items in the array will be used for the file fragmented in 5 portions. If the function failed with <tt>FR_NOT_ENOUGH_CORE</tt>, the size of given array is insufficient for the file.</p>
|
||||
<p>The fast seek feature enables fast backward/long seek operations without FAT access by using an on-memory CLMT (cluster link map table). It is applied to <tt>f_read</tt> and <tt>f_write</tt> function as well, however, the file size cannot be expanded by <tt>f_write</tt>, <tt>f_lseek</tt> function while the file is in fast seek mode.</p>
|
||||
<p>The fast seek mode is available when <tt>FF_USE_FASTSEEK = 1</tt>. The CLMT must be created into a <tt>DWORD</tt> array prior to use the fast seek mode. To create the CLMT, set address of the <tt>DWORD</tt> array to the member <tt>cltbl</tt> in the open file object, set the size of array in unit of items to the <tt>cltbl[0]</tt> and then call <tt>f_lseek</tt> function with <tt class="arg">ofs</tt><tt> = CREATE_LINKMAP</tt>. The number of items used or required is returned into the <tt>cltbl[0]</tt>. The number of items needed is (number of the file fragments + 1) * 2. For example, 12 items in the array will be used for the file fragmented in 5 portions. If the function failed with <tt>FR_NOT_ENOUGH_CORE</tt>, the size of given array is insufficient for the file. After the function succeeded, no FAT access is occured in subsequent <tt>f_read</tt>, <tt>f_write</tt>, <tt>f_lseek</tt> function to the file. To disable the fast seek mode, set null pointer to the <tt>cltbl</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -78,7 +77,7 @@ FRESULT f_rewind (
|
||||
<pre>
|
||||
<span class="c">/* Open file */</span>
|
||||
fp = malloc(sizeof (FIL));
|
||||
res = f_open(fp, "file.dat", FA_READ|FA_WRITE);
|
||||
res = <em>f_open</em>(fp, "file.dat", FA_READ|FA_WRITE);
|
||||
if (res) ...
|
||||
|
||||
<span class="c">/* Set read/write pointer to 5000 */</span>
|
||||
@@ -96,15 +95,15 @@ FRESULT f_rewind (
|
||||
<pre>
|
||||
<span class="c">/* Cluster pre-allocation (to prevent buffer overrun on streaming write) */</span>
|
||||
|
||||
res = f_open(fp, recfile, FA_CREATE_NEW | FA_WRITE); <span class="c">/* Create a file */</span>
|
||||
res = <em>f_open</em>(fp, recfile, FA_CREATE_NEW | FA_WRITE); <span class="c">/* Create a file */</span>
|
||||
|
||||
res = <em>f_lseek</em>(fp, PRE_SIZE); <span class="c">/* Expand file size (cluster pre-allocation) */</span>
|
||||
if (res || f_tell(fp) != PRE_SIZE) ... <span class="c">/* Check if the file has been expanded successfly */</span>
|
||||
if (res || <em>f_tell</em>(fp) != PRE_SIZE) ... <span class="c">/* Check if the file has been expanded successfly */</span>
|
||||
|
||||
res = <em>f_lseek</em>(fp, OFS_DATA); <span class="c">/* Record data stream with free from cluster allocation delay */</span>
|
||||
... <span class="c">/* Write operation should be aligned to sector boundary to optimize the write throughput */</span>
|
||||
|
||||
res = f_truncate(fp); <span class="c">/* Truncate unused area */</span>
|
||||
res = <em>f_truncate</em>(fp); <span class="c">/* Truncate unused area */</span>
|
||||
res = <em>f_lseek</em>(fp, OFS_HEADER); <span class="c">/* Set file header */</span>
|
||||
...
|
||||
|
||||
@@ -115,7 +114,7 @@ FRESULT f_rewind (
|
||||
|
||||
DWORD clmt[SZ_TBL]; <span class="c">/* Cluster link map table buffer */</span>
|
||||
|
||||
res = f_open(fp, fname, FA_READ | FA_WRITE); <span class="c">/* Open a file */</span>
|
||||
res = <em>f_open</em>(fp, fname, FA_READ | FA_WRITE); <span class="c">/* Open a file */</span>
|
||||
|
||||
res = <em>f_lseek</em>(fp, ofs1); <span class="c">/* This is normal seek (cltbl is nulled on file open) */</span>
|
||||
|
||||
@@ -134,6 +133,7 @@ FRESULT f_rewind (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="truncate.html">f_truncate</a>, <a href="expand.html">f_expand</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mkdir.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_mkdir</title>
|
||||
</head>
|
||||
@@ -75,6 +73,7 @@ FRESULT f_mkdir (
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+14
-15
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mkfs.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_mkfs</title>
|
||||
</head>
|
||||
@@ -36,12 +34,12 @@ FRESULT f_mkfs (
|
||||
<dd>Specifies a combination of FAT type flags, <tt>FM_FAT</tt>, <tt>FM_FAT32</tt>, <tt>FM_EXFAT</tt> and bitwise-or of these three, <tt>FM_ANY</tt>. <tt>FM_EXFAT</tt> is ignored when exFAT is not enabled. These flags specify which type of FAT volume to be created. If two or more types are specified, one out of them will be selected depends on the volume size and <tt class="arg">au_size</tt>. The flag <tt>FM_SFD</tt> specifies to create the volume on the drive in SFD format. The default value is <tt>FM_ANY</tt>.</dd>
|
||||
<dt>BYTE n_fat</dt>
|
||||
<dd>Specifies number of FAT copies on the FAT/FAT32 volume. Valid value for this member is 1 or 2. The default value (0) and any invaid value gives 1. If the FAT type is exFAT, this member has no effect.</dd>
|
||||
<dt>UINT n_align</dt>
|
||||
<dd>Specifies alignment of the volume data area (file allocation pool, usually erase block boundary of flash memory media) in unit of sector. The valid value for this member is between 1 and 32768 inclusive in power of 2. If a zero (the default value) or any invalid value is given, the function obtains the block size from lower layer with <tt>disk_ioctl</tt> function.</dd>
|
||||
<dt>DWORD au_size</dt>
|
||||
<dd>Specifies size of the allocation unit (cluter) in unit of byte. The valid value is power of 2 between sector size and 128 * sector size inclusive for FAT/FAT32 volume, or up to 16 MB for exFAT volume. If a zero (default value) or any invalid value is given, the function uses default allocation unit size depends on the volume size.</dd>
|
||||
<dt>UINT align</dt>
|
||||
<dd>Specifies alignment of the volume data area (file allocation pool, usually erase block boundary of flash memory media) <em>in unit of sector</em>. The valid value for this member is between 1 and 32768 inclusive in power of 2. If a zero (the default value) or an invalid value is given, the function obtains the block size from lower layer with <tt>disk_ioctl</tt> function.</dd>
|
||||
<dt>UINT n_root</dt>
|
||||
<dd>Specifies number of root directory entries on the FAT volume. Valid value for this member is up to 32768 and aligned to sector size / 32. The default value (0) and any invaid value gives 512. If the FAT type is FAT32 or exFAT, this member has no effect.</dd>
|
||||
<dt>DWORD au_size</dt>
|
||||
<dd>Specifies size of the cluster (allocation unit) <em>in unit of byte</em>. The valid value for this member is between sector size and 128 * sector size inclusive in power of 2 for FAT/FAT32 volume and up to 16 MB in power of 2 for exFAT volume. If a zero (default value) or an invalid value is given, the function uses a default cluster size depends on the volume size.</dd>
|
||||
</dl>
|
||||
<dt>work</dt>
|
||||
<dd>Pointer to the working buffer used for the format process. If a null pointer is given with <tt><a href="config.html#use_lfn">FF_USE_LFN</a> == 3</tt>, the function uses a <tt>len</tt> bytes of heap memory in this function.</dd>
|
||||
@@ -69,9 +67,9 @@ FRESULT f_mkfs (
|
||||
<p>The FAT sub-type, FAT12/FAT16/FAT32, of FAT volume except exFAT is determined by only number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus the FAT sub-type of created volume depends on the volume size and the cluster size. In case of the combination of FAT type and cluter size specified by argument is not valid for the volume size, the function will fail with <tt>FR_MKFS_ABORTED</tt>.</p>
|
||||
<p>The allocation unit, also known as <em>cluster</em>, is a unit of disk space allocation for files. When the size of allocation unit is 32768 bytes, a file with 100 bytes in size occupies 32768 bytes of disk space. The space efficiency of disk usage gets worse as increasing size of allocation unit, but, on the other hand, the read/write performance increases. Therefore the size of allocation unit is a trade-off between space efficiency and performance. For the large volumes in GB order, 32768 bytes or larger, automatically selected by default, is recommended for most case unless extremely many small files are created in the volume.</p>
|
||||
<p>When the logical drive to be formatted is associated with a physical drive (<tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a> == 0</tt> or <tt>VolToPart[].pt == 0</tt>) and <tt>FM_SFD</tt> flag is not specified, a partition occupies entire drive space is created and then the FAT volume is created in the partition. When <tt>FM_SFD</tt> flag is specified, the FAT volume is created without any disk partitioning.</p>
|
||||
<p>When the logical drive to be formatted is associated with a specific partition by multiple partition feature (<tt>FF_MULTI_PARTITION == 1</tt> and <tt>VolToPart[].pt > 0</tt>), the FAT volume is created in the partition of the physical drive specified by <a href="filename.html#vol">volume mapping table</a> and <tt>FM_SFD</tt> flag is ignored. The hosting physical drive needs to be partitioned with <tt>f_fdisk</tt> function or any partitioning tool prior to create the FAT volume with this function. If the partition is not exist, the function aborts with <tt>FR_MKFS_ABORTED</tt>.</p>
|
||||
<p>There are three standard disk partitioning formats, MBR, GPT and SFD. The MBR format, also known as FDISK format, is usually used for harddisk, memory card and U disk. It can divide a physical drive into one or more partitions with a partition table. The GPT, GUID Partition Table, is a newly defined patitioning format for large storage devices. FatFs suppors the GPT only when 64-bit LBA is enabled. The SFD, Super-Floppy Disk, is non-partitioned disk format. The FAT volume is located at LBA 0 and occupies the entire physical drive without any disk partitioning. It is usually used for floppy disk, optical disk and most super-floppy media. Some combination of systems and media support only either partitioned format or non-partitioned format and the other is not supported.</p>
|
||||
<p>Some systems manage the partitions in the on-board storage in non-standard format. The partitions are mapped as physical drives identified by <tt class="arg">pdrv</tt> in <tt>disk_*</tt> functions. For such systems, SFD format is suitable to create the FAT volume in the partition.</p>
|
||||
<p>When the logical drive to be formatted is associated with a specific partition by multiple partition feature (<tt>FF_MULTI_PARTITION == 1</tt> and <tt>VolToPart[].pt > 0</tt>), the FAT volume is created in the partition of the physical drive specified by <a href="filename.html#vol">volume mapping table</a> and <tt>FM_SFD</tt> flag is ignored. The hosting physical drive needs to be partitioned with <tt>f_fdisk</tt> function or some partitioning tool prior to create the FAT volume with this function. If the partition is not exist, the function fails with <tt>FR_MKFS_ABORTED</tt>.</p>
|
||||
<p>There are three standard disk partitioning formats, MBR, GPT and SFD. The MBR format, also known as FDISK format, is usually used for harddisk, memory card and U disk. It can divide a physical drive into one or more partitions with a partition table. The GPT, GUID Partition Table, is a newly defined patitioning format for large storage devices. FatFs suppors the GPT only when 64-bit LBA is enabled. The SFD, Super-Floppy Disk, is non-partitioned disk format. The FAT volume is located at LBA 0 and occupies the entire physical drive without disk partitioning. It is usually used for floppy disk, optical disk and most super-floppy media. Some combination of systems and media support only either partitioned format or non-partitioned format and the other is not supported.</p>
|
||||
<p>Some systems manage the partitions of on-board storage in non-standard format. The partitions are mapped as physical drives identified by <tt class="arg">pdrv</tt> in <tt>disk_*</tt> functions. For such systems, SFD format is suitable to create the FAT volume in the partition.</p>
|
||||
</div>
|
||||
|
||||
<div class="para comp">
|
||||
@@ -97,21 +95,21 @@ int main (void)
|
||||
if (res) ...
|
||||
|
||||
<span class="c">/* Give a work area to the default drive */</span>
|
||||
f_mount(&fs, "", 0);
|
||||
<em>f_mount</em>(&fs, "", 0);
|
||||
|
||||
<span class="c">/* Create a file as new */</span>
|
||||
res = f_open(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE);
|
||||
res = <em>f_open</em>(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE);
|
||||
if (res) ...
|
||||
|
||||
<span class="c">/* Write a message */</span>
|
||||
f_write(&fil, "Hello, World!\r\n", 15, &bw);
|
||||
<em>f_write</em>(&fil, "Hello, World!\r\n", 15, &bw);
|
||||
if (bw != 15) ...
|
||||
|
||||
<span class="c">/* Close the file */</span>
|
||||
f_close(&fil);
|
||||
<em>f_close</em>(&fil);
|
||||
|
||||
<span class="c">/* Unregister work area */</span>
|
||||
f_mount(0, "", 0);
|
||||
<em>f_mount</em>(0, "", 0);
|
||||
|
||||
...
|
||||
</pre>
|
||||
@@ -122,6 +120,7 @@ int main (void)
|
||||
<p><a href="../res/mkfs.xlsx">Example of volume size and format parameters</a>, <a href="filename.html#vol">Volume management</a>, <tt><a href="fdisk.html">f_fdisk</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+16
-17
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mount.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_mount</title>
|
||||
</head>
|
||||
@@ -32,11 +30,11 @@ FRESULT f_unmount (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -55,7 +53,7 @@ FRESULT f_unmount (
|
||||
|
||||
<div class="para desc">
|
||||
<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>
|
||||
<ol>
|
||||
<li>Determines the logical drive which specified by <tt class="arg">path</tt>.</li>
|
||||
@@ -63,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>Performs volume mount process to the volume if forced mounting is specified.</li>
|
||||
</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 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 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. 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>
|
||||
<li>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 filesystem object has not been initialized. It is de-initialized by <tt>f_mount</tt> function.</li>
|
||||
<li>The physical drive is not initialized. It is de-initialized by system reset or media removal.</li>
|
||||
</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 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>
|
||||
<pre>
|
||||
#define <em>f_unmount</em>(path) f_mount(0, path, 0)
|
||||
@@ -92,19 +90,19 @@ int main (void)
|
||||
FATFS *fs; <span class="c">/* Ponter to the filesystem object */</span>
|
||||
|
||||
|
||||
fs = malloc(sizeof (FATFS)); <span class="c">/* Get work area for the volume */</span>
|
||||
<em>f_mount</em>(fs, "", 0); <span class="c">/* Mount the default drive */</span>
|
||||
fs = malloc(sizeof (FATFS)); <span class="c">/* Get work area for the volume */</span>
|
||||
<em>f_mount</em>(fs, "", 0); <span class="c">/* Mount the default drive */</span>
|
||||
|
||||
f_open(... <span class="c">/* Here any file API can be used */</span>
|
||||
f_open(... <span class="c">/* Here any file API can be used */</span>
|
||||
|
||||
...
|
||||
|
||||
<em>f_mount</em>(fs, "", 0); <span class="c">/* Re-mount the default drive to reinitialize the filesystem */</span>
|
||||
<em>f_mount</em>(fs, "", 0); <span class="c">/* Re-mount the default drive to reinitialize the filesystem */</span>
|
||||
|
||||
...
|
||||
|
||||
<em>f_mount</em>(0, "", 0); <span class="c">/* Unmount the default drive */</span>
|
||||
free(fs); <span class="c">/* Here the work area can be discarded */</span>
|
||||
<em>f_unmount</em>(""); <span class="c">/* Unmount the default drive */</span>
|
||||
free(fs); <span class="c">/* Here the work area can be discarded */</span>
|
||||
|
||||
...
|
||||
}
|
||||
@@ -117,6 +115,7 @@ int main (void)
|
||||
<p><tt><a href="open.html">f_open</a></tt>, <tt><a href="sfatfs.html">FATFS</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+21
-21
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/open.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_open</title>
|
||||
</head>
|
||||
@@ -27,19 +25,19 @@ FRESULT f_open (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the blank file object structure.</dd>
|
||||
<dd>Pointer to the blank file object structure. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">file name</a> to open or create.</dd>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">file name</a> to open or create. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
|
||||
<dt>mode</dt>
|
||||
<dd>Mode flags that specifies the type of access and open method for the file. It is specified by a combination of following flags.<br>
|
||||
<table class="lst">
|
||||
<tr><th>Flags</th><th>Meaning</th></tr>
|
||||
<tr><td>FA_READ</td><td>Specifies read access to the file. Data can be read from the file.</tr>
|
||||
<tr><td>FA_WRITE</td><td>Specifies write access to the file. Data can be written to the file. Combine with <tt>FA_READ</tt> for read-write access.</td></tr>
|
||||
<tr><td>FA_OPEN_EXISTING</td><td>Opens a file. The function fails if the file is not existing. (Default)</td></tr>
|
||||
<tr><td>FA_CREATE_NEW</td><td>Creates a new file. The function fails with <tt>FR_EXIST</tt> if the file is existing.</td></tr>
|
||||
<tr><td>FA_CREATE_ALWAYS</td><td>Creates a new file. If the file is existing, it will be truncated and overwritten.</td></tr>
|
||||
<tr><td>FA_OPEN_ALWAYS</td><td>Opens the file if it is existing. If not, a new file will be created.</td></tr>
|
||||
<tr><td>FA_OPEN_EXISTING</td><td>Opens the file. The function fails if the file is not existing. (Default)</td></tr>
|
||||
<tr><td>FA_CREATE_ALWAYS</td><td>Creates a new file. If the file is existing, the file is truncated and overwritten.</td></tr>
|
||||
<tr><td>FA_CREATE_NEW</td><td>Creates a new file. The function fails if the file is existing.</td></tr>
|
||||
<tr><td>FA_OPEN_ALWAYS</td><td>Opens the file. If it is not exist, a new file is created.</td></tr>
|
||||
<tr><td>FA_OPEN_APPEND</td><td>Same as <tt>FA_OPEN_ALWAYS</tt> except the read/write pointer is set end of the file.</td></tr>
|
||||
</table>
|
||||
Mode flags in POSIX fopen() function corresponds to FatFs mode flags as follows:<br>
|
||||
@@ -86,7 +84,8 @@ Mode flags in POSIX fopen() function corresponds to FatFs mode flags as follows:
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The <tt>f_open</tt> function opens a file and creates a <em>file object</em>. The file object is an identifier for subsequent operations to the file. Open file should be closed with <a href="close.html"><tt>f_close</tt></a> function after the session of the file access. If any change to the file has been made and not closed prior to power off, media removal or re-mount, or the file can be collapsed.</p>
|
||||
<p>The <tt>f_open</tt> function opens a file and creates a <em>file object</em>. It is the identifier for subsequent read/write operations to the file. After the function succeeded, the file object is valid. If the function failed, the file object is set invalid.</p>
|
||||
<p>Open file should be closed with <a href="close.html"><tt>f_close</tt></a> function after the session of the file access. If any change to the file has been made and not closed prior to power off, media removal or re-mount, or the file can be collapsed.</p>
|
||||
<p>If duplicated file open is needed, read <a href="appnote.html#dup">here</a> carefully. However duplicated open of a file with any write mode flag is always prohibited.</p>
|
||||
</div>
|
||||
|
||||
@@ -112,19 +111,19 @@ int main (void)
|
||||
|
||||
|
||||
<span class="c">/* Give a work area to the default drive */</span>
|
||||
f_mount(&FatFs, "", 0);
|
||||
<em>f_mount</em>(&FatFs, "", 0);
|
||||
|
||||
<span class="c">/* Open a text file */</span>
|
||||
fr = <em>f_open</em>(&fil, "message.txt", FA_READ);
|
||||
if (fr) return (int)fr;
|
||||
|
||||
<span class="c">/* Read every line and display it */</span>
|
||||
while (f_gets(line, sizeof line, &fil)) {
|
||||
while (<em>f_gets</em>(line, sizeof line, &fil)) {
|
||||
printf(line);
|
||||
}
|
||||
|
||||
<span class="c">/* Close the file */</span>
|
||||
f_close(&fil);
|
||||
<em>f_close</em>(&fil);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -142,8 +141,8 @@ int main (void)
|
||||
|
||||
|
||||
<span class="c">/* Give work areas to each logical drive */</span>
|
||||
f_mount(&fs0, "0:", 0);
|
||||
f_mount(&fs1, "1:", 0);
|
||||
<em>f_mount</em>(&fs0, "0:", 0);
|
||||
<em>f_mount</em>(&fs1, "1:", 0);
|
||||
|
||||
<span class="c">/* Open source file on the drive 1 */</span>
|
||||
fr = <em>f_open</em>(&fsrc, "1:file.bin", FA_READ);
|
||||
@@ -155,19 +154,19 @@ int main (void)
|
||||
|
||||
<span class="c">/* Copy source to destination */</span>
|
||||
for (;;) {
|
||||
fr = f_read(&fsrc, buffer, sizeof buffer, &br); <span class="c">/* Read a chunk of data from the source file */</span>
|
||||
fr = <em>f_read</em>(&fsrc, buffer, sizeof buffer, &br); <span class="c">/* Read a chunk of data from the source file */</span>
|
||||
if (br == 0) break; <span class="c">/* error or eof */</span>
|
||||
fr = f_write(&fdst, buffer, br, &bw); <span class="c">/* Write it to the destination file */</span>
|
||||
fr = <em>f_write</em>(&fdst, buffer, br, &bw); <span class="c">/* Write it to the destination file */</span>
|
||||
if (bw < br) break; <span class="c">/* error or disk full */</span>
|
||||
}
|
||||
|
||||
<span class="c">/* Close open files */</span>
|
||||
f_close(&fsrc);
|
||||
f_close(&fdst);
|
||||
<em>f_close</em>(&fsrc);
|
||||
<em>f_close</em>(&fdst);
|
||||
|
||||
<span class="c">/* Unregister work area prior to discard it */</span>
|
||||
f_unmount("0:");
|
||||
f_unmount("1:");
|
||||
<em>f_unmount</em>("0:");
|
||||
<em>f_unmount</em>("1:");
|
||||
|
||||
return (int)fr;
|
||||
}
|
||||
@@ -180,6 +179,7 @@ int main (void)
|
||||
<p><tt><a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/opendir.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_opendir</title>
|
||||
</head>
|
||||
@@ -26,9 +24,9 @@ FRESULT f_opendir (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>dp</dt>
|
||||
<dd>Pointer to the blank directory object to create a new one.</dd>
|
||||
<dd>Pointer to the blank directory object to create a new one. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">directory name</a> to be opened.</dd>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">directory name</a> to be opened. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -70,6 +68,7 @@ FRESULT f_opendir (
|
||||
<p><tt><a href="readdir.html">f_readdir</a>, <a href="closedir.html">f_closedir</a>, <a href="sdir.html">DIR</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+114
-115
@@ -1,115 +1,114 @@
|
||||
<!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="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/printf.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_printf</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para func">
|
||||
<h2>f_printf</h2>
|
||||
<p>The f_printf function writes formatted string to the file.</p>
|
||||
<pre>
|
||||
int f_printf (
|
||||
FIL* <span class="arg">fp</span>, <span class="c">/* [IN] File object */</span>
|
||||
const TCHAR* <span class="arg">fmt</span>, <span class="c">/* [IN] Format stirng */</span>
|
||||
...
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para arg">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the open file object structure.</dd>
|
||||
<dt>fmt</dt>
|
||||
<dd>Pointer to the null <tt>'\0'</tt> terminated format string. The terminator character will not be output.</dd>
|
||||
<dt>...</dt>
|
||||
<dd>Optional arguments...</dd>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para ret">
|
||||
<h4>Return Values</h4>
|
||||
<p>When the string was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or an error, a negative value will be returned.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The format control directive is a sub-set of standard library shown as follows:</p>
|
||||
<pre>
|
||||
%[flag][width][precision][size]type
|
||||
</pre>
|
||||
<dl>
|
||||
<dt>flag</dt><dd>Padding option. A <tt>-</tt> specifies left-aligned. A <tt>0</tt> specifies zero padded. The default setting is in right-aligned and space padded.</dd>
|
||||
<dt>width</dt><dd>Minimum width of the field, <tt>1-99</tt> or <tt>*</tt>. If the width of generated string is less than the minimum width, rest field is padded with spaces or zeros. An <tt>*</tt> specifies the value comes from an argument in int type. The default setting is zero.</dd>
|
||||
<dt>precision</dt><dd>Specifies number of fractional digits or maximum width of string, <tt>.0-.99</tt> or <tt>.*</tt>. If the number is omitted, it is same as <tt>.0</tt>. Default setting is 6 for number and no limit for string.</dd>
|
||||
<dt>size</dt><dd>Specifies size of integer argument, <tt>l</tt>(long) and <tt>ll</tt>(long long). If <tt>sizeof (long) == sizeof (int)</tt> is true (this is typical of 32-bit systems), prefix <tt>l</tt> can be omitted for long integer argument. The default size is int for integer argument and floating point argument is always assumed double as the default argument promotion.</dd>
|
||||
<dt>type</dt><dd>Specifies type of the output format and the argument as shown below. The length of generated string is in assumtion of int is 32-bit.
|
||||
<table class="lst1">
|
||||
<tr><th>Type</th><th>Format</th><th>Argument</th><th>Length</th></tr>
|
||||
<tr><td><tt>c</tt></td><td>Character</td><td rowspan="6"><tt>int</tt>,<br><tt>long</tt>,<br><tt>long long</tt></td><td>1 character.</td></tr>
|
||||
<tr><td><tt>d</tt></td><td>Signed decimal</td><td>1 to 11 (20 for ll) characters.</td></tr>
|
||||
<tr><td><tt>u</tt></td><td>Unsigned decimal</td><td>1 to 10 (20 for ll) characters.</td></tr>
|
||||
<tr><td><tt>o</tt></td><td>Unsigned octal</td><td>1 to 11 (22 for ll) characters.</td></tr>
|
||||
<tr><td><tt>x X</tt></td><td>Unsigned hexdecimal</td><td>1 to 8 (16 for ll) characters.</td></tr>
|
||||
<tr><td><tt>b</tt></td><td>Unsigned binary</td><td>1 to 32 characters. Limited to lower 32 digits when ll is specified.</td></tr>
|
||||
<tr><td><tt>s</tt></td><td>String</td><td><tt>TCHAR*</tt></td><td>As input string. Null pointer generates a null string.</td></tr>
|
||||
<tr><td><tt>f</tt></td><td>Floating point<br>(decimal)</td><td rowspan="2"><tt>double</tt></td><td>1 to 31 characters. If the number of characters exceeds 31, it writes <tt>"±OV"</tt>. Not a number and infinite write <tt>"NaN"</tt> and <tt>"±INF"</tt>.</td></tr>
|
||||
<tr><td><tt>e E</tt></td><td>Floating point<br>(e notation)</td><td>4 to 31 characters. If the number of characters exceeds 31 or exponent exceeds +99, it writes <tt>"±OV"</tt>.</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>When FatFs is configured for Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding <em>on the file</em> to be written via this function is selected by <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a></tt>. The characters with wrong encoding or invalid for the output encoding will be lost.</p>
|
||||
<p>If <tt>sprintf</tt> is used in the project and code conversion is not needed, <tt>f_write</tt> with <tt>sprintf</tt> will be efficient in code size and performance rather than <tt>f_printf</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para comp">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>This is a wrapper function of <a href="write.html"><tt>f_write</tt></a> function. Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_strfunc">FF_USE_STRFUNC</a> >= 1</tt>. When <tt>FF_USE_STRFUNC == 2</tt>, <tt>'\n'</tt>s in the generated string are written as <tt>'\r'+'\n'</tt> each.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para use">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
<em>f_printf</em>(fp, "%d", 1234); <span class="c">/* "1234" */</span>
|
||||
<em>f_printf</em>(fp, "%6d,%3d%%", -200, 5); <span class="c">/* " -200, 5%" */</span>
|
||||
<em>f_printf</em>(fp, "%-6u", 100); <span class="c">/* "100 " */</span>
|
||||
<em>f_printf</em>(fp, "%ld", 12345678); <span class="c">/* "12345678" */</span>
|
||||
<em>f_printf</em>(fp, "%llu", 0x100000000); <span class="c">/* "4294967296" (<a href="config.html#print_lli">FF_PRINT_LLI</a>) */</span>
|
||||
<em>f_printf</em>(fp, "%lld", -1LL); <span class="c">/* "-1" (FF_PRINT_LLI) */</span>
|
||||
<em>f_printf</em>(fp, "%04x", 0xA3); <span class="c">/* "00a3" */</span>
|
||||
<em>f_printf</em>(fp, "%08lX", 0x123ABC); <span class="c">/* "00123ABC" */</span>
|
||||
<em>f_printf</em>(fp, "%016b", 0x550F); <span class="c">/* "0101010100001111" */</span>
|
||||
<em>f_printf</em>(fp, "%*d", 6, 100); <span class="c">/* " 100" */</span>
|
||||
<em>f_printf</em>(fp, "%s", "abcdefg"); <span class="c">/* "abcdefg" */</span>
|
||||
<em>f_printf</em>(fp, "%5s", "abc"); <span class="c">/* " abc" */</span>
|
||||
<em>f_printf</em>(fp, "%-5s", "abc"); <span class="c">/* "abc " */</span>
|
||||
<em>f_printf</em>(fp, "%.5s", "abcdefg"); <span class="c">/* "abcde" */</span>
|
||||
<em>f_printf</em>(fp, "%-5.2s", "abcdefg"); <span class="c">/* "ab " */</span>
|
||||
<em>f_printf</em>(fp, "%c", 'a'); <span class="c">/* "a" */</span>
|
||||
<em>f_printf</em>(fp, "%12f", 10.0); <span class="c">/* " 10.000000" (<a href="config.html#print_fp">FF_PRINT_FLOAT</a>) */</span>
|
||||
<em>f_printf</em>(fp, "%.4E", 123.45678); <span class="c">/* "1.2346E+02" (FF_PRINT_FLOAT) */</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para ref">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
<!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 - f_printf</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="para func">
|
||||
<h2>f_printf</h2>
|
||||
<p>The f_printf function writes formatted string to the file.</p>
|
||||
<pre>
|
||||
int f_printf (
|
||||
FIL* <span class="arg">fp</span>, <span class="c">/* [IN] File object */</span>
|
||||
const TCHAR* <span class="arg">fmt</span>, <span class="c">/* [IN] Format stirng */</span>
|
||||
...
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="para arg">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the open file object structure.</dd>
|
||||
<dt>fmt</dt>
|
||||
<dd>Pointer to the null <tt>'\0'</tt> terminated format string. The terminator character will not be output.</dd>
|
||||
<dt>...</dt>
|
||||
<dd>Optional arguments...</dd>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para ret">
|
||||
<h4>Return Values</h4>
|
||||
<p>When the string was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or an error, a negative value will be returned.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The format control directive is a sub-set of standard library shown as follows:</p>
|
||||
<pre>
|
||||
%[flag][width][precision][size]type
|
||||
</pre>
|
||||
<dl>
|
||||
<dt>flag</dt><dd>Padding option. A <tt>-</tt> specifies left-aligned. A <tt>0</tt> specifies zero padded. The default setting is in right-aligned and space padded.</dd>
|
||||
<dt>width</dt><dd>Minimum width of the field, <tt>1-99</tt> or <tt>*</tt>. If the width of generated string is less than the minimum width, rest field is padded with spaces or zeros. An <tt>*</tt> specifies the value comes from an argument in int type. The default setting is zero.</dd>
|
||||
<dt>precision</dt><dd>Specifies number of fractional digits or maximum width of string, <tt>.0-.99</tt> or <tt>.*</tt>. If the number is omitted, it is same as <tt>.0</tt>. Default setting is 6 for number and no limit for string.</dd>
|
||||
<dt>size</dt><dd>Specifies size of integer argument, <tt>l</tt>(long) and <tt>ll</tt>(long long). If <tt>sizeof (long) == sizeof (int)</tt> is true (this is typical of 32-bit systems), prefix <tt>l</tt> can be omitted for long integer argument. The default size is int for integer argument and floating point argument is always assumed double as the default argument promotion.</dd>
|
||||
<dt>type</dt><dd>Specifies type of the output format and the argument as shown below. The length of generated string is in assumtion of int is 32-bit.
|
||||
<table class="lst1">
|
||||
<tr><th>Type</th><th>Format</th><th>Argument</th><th>Length</th></tr>
|
||||
<tr><td><tt>c</tt></td><td>Character</td><td rowspan="6"><tt>int</tt>,<br><tt>long</tt>,<br><tt>long long</tt></td><td>1 character.</td></tr>
|
||||
<tr><td><tt>d</tt></td><td>Signed decimal</td><td>1 to 11 (20 for ll) characters.</td></tr>
|
||||
<tr><td><tt>u</tt></td><td>Unsigned decimal</td><td>1 to 10 (20 for ll) characters.</td></tr>
|
||||
<tr><td><tt>o</tt></td><td>Unsigned octal</td><td>1 to 11 (22 for ll) characters.</td></tr>
|
||||
<tr><td><tt>x X</tt></td><td>Unsigned hexdecimal</td><td>1 to 8 (16 for ll) characters.</td></tr>
|
||||
<tr><td><tt>b</tt></td><td>Unsigned binary</td><td>1 to 32 characters. Limited to lower 32 digits when ll is specified.</td></tr>
|
||||
<tr><td><tt>s</tt></td><td>String</td><td><tt>TCHAR*</tt></td><td>As input string. A null pointer generates a zero-length string.</td></tr>
|
||||
<tr><td><tt>f</tt></td><td>Floating point<br>(decimal)</td><td rowspan="2"><tt>double</tt></td><td>1 to 31 characters. If the number of characters exceeds 31, it writes <tt>"±OV"</tt>. Not a number and infinite value write <tt>"NaN"</tt> and <tt>"±INF"</tt> respectively.</td></tr>
|
||||
<tr><td><tt>e E</tt></td><td>Floating point<br>(e notation)</td><td>4 to 31 characters. If the number of characters exceeds 31 or exponent exceeds +99, it writes <tt>"±OV"</tt>.</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>When FatFs is configured for Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding <em>on the file</em> to be written via this function is selected by <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a></tt>. If the character encoding differs between file data and API, it is converted in this function. Input characters with wrong encoding for output will be lost.</p>
|
||||
<p>If <tt>sprintf</tt> is used in the project and code conversion is not needed, <tt>f_write</tt> with <tt>sprintf</tt> will be efficient in code size and performance rather than <tt>f_printf</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para comp">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>This is a wrapper function of <a href="write.html"><tt>f_write</tt></a> function. Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_strfunc">FF_USE_STRFUNC</a> >= 1</tt>. When <tt>FF_USE_STRFUNC == 2</tt>, <tt>'\n'</tt>s in the generated string are written as <tt>'\r'+'\n'</tt> each.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para use">
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
<em>f_printf</em>(fp, "%d", 1234); <span class="c">/* "1234" */</span>
|
||||
<em>f_printf</em>(fp, "%6d,%3d%%", -200, 5); <span class="c">/* " -200, 5%" */</span>
|
||||
<em>f_printf</em>(fp, "%-6u", 100); <span class="c">/* "100 " */</span>
|
||||
<em>f_printf</em>(fp, "%ld", 12345678); <span class="c">/* "12345678" */</span>
|
||||
<em>f_printf</em>(fp, "%llu", 0x100000000); <span class="c">/* "4294967296" (<a href="config.html#print_lli">FF_PRINT_LLI</a>) */</span>
|
||||
<em>f_printf</em>(fp, "%lld", -1LL); <span class="c">/* "-1" (FF_PRINT_LLI) */</span>
|
||||
<em>f_printf</em>(fp, "%04x", 0xA3); <span class="c">/* "00a3" */</span>
|
||||
<em>f_printf</em>(fp, "%08lX", 0x123ABC); <span class="c">/* "00123ABC" */</span>
|
||||
<em>f_printf</em>(fp, "%016b", 0x550F); <span class="c">/* "0101010100001111" */</span>
|
||||
<em>f_printf</em>(fp, "%*d", 6, 100); <span class="c">/* " 100" */</span>
|
||||
<em>f_printf</em>(fp, "%s", "abcdefg"); <span class="c">/* "abcdefg" */</span>
|
||||
<em>f_printf</em>(fp, "%5s", "abc"); <span class="c">/* " abc" */</span>
|
||||
<em>f_printf</em>(fp, "%-5s", "abc"); <span class="c">/* "abc " */</span>
|
||||
<em>f_printf</em>(fp, "%.5s", "abcdefg"); <span class="c">/* "abcde" */</span>
|
||||
<em>f_printf</em>(fp, "%-5.2s", "abcdefg"); <span class="c">/* "ab " */</span>
|
||||
<em>f_printf</em>(fp, "%c", 'a'); <span class="c">/* "a" */</span>
|
||||
<em>f_printf</em>(fp, "%12f", 10.0); <span class="c">/* " 10.000000" (<a href="config.html#print_fp">FF_PRINT_FLOAT</a>) */</span>
|
||||
<em>f_printf</em>(fp, "%.4E", 123.45678); <span class="c">/* "1.2346E+02" (FF_PRINT_FLOAT) */</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para ref">
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/putc.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_putc</title>
|
||||
</head>
|
||||
@@ -55,6 +53,7 @@ int f_putc (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/puts.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_puts</title>
|
||||
</head>
|
||||
@@ -41,7 +39,7 @@ int f_puts (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>When FatFs is configured for Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The input Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding <em>on the file</em> to be written via this functions is selected by <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a></tt>. The characters with wrong encoding or invalid for the output encoding will be lost.</p>
|
||||
<p>When FatFs is configured for Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> >= 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The input Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding <em>on the file</em> to be written via this functions is selected by <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a></tt>. If the character encoding differs between file data and API, it is converted in this function. Input characters with wrong encoding for output will be lost.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -56,6 +54,7 @@ int f_puts (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+21
-21
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/rc.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - API Return Code</title>
|
||||
</head>
|
||||
@@ -19,7 +17,7 @@
|
||||
<dd>The function succeeded.</dd>
|
||||
|
||||
<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>
|
||||
<dd>Assertion failed and an insanity is detected in the internal process. One of the following possibilities is suspected.
|
||||
@@ -29,7 +27,7 @@
|
||||
<li>There is a bug in the FatFs module itself.</li>
|
||||
<li>Wrong lower layer implementation.</li>
|
||||
</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>
|
||||
|
||||
<dt id="nr">FR_NOT_READY</dt>
|
||||
@@ -46,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>
|
||||
|
||||
<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>
|
||||
<dd>The given string is invalid as a <a href="filename.html">path name</a>. One of the following possibilities is suspected.
|
||||
<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><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>
|
||||
</ul>
|
||||
</dd>
|
||||
@@ -61,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>
|
||||
<dd>The required access was denied due to one of the following reasons:
|
||||
<ul>
|
||||
<li>Write mode open against the read-only file. (f_open)</li>
|
||||
<li>Deleting the read-only file or directory. (f_unlink)</li>
|
||||
<li>Deleting the non-empty directory or current directory. (f_unlink)</li>
|
||||
<li>Reading the file opened without <tt>FA_READ</tt> flag. (f_read)</li>
|
||||
<li>Any modification to the file opened without <tt>FA_WRITE</tt> flag. (f_write, f_truncate, f_expand)</li>
|
||||
<li>Could not create the object due to root directory full or disk full. (f_open, f_mkdir)</li>
|
||||
<li>Could not find a contiguous area for the file. (f_expand)</li>
|
||||
<li>Write mode open against the read-only file. (<tt>f_open</tt>)</li>
|
||||
<li>Deleting the read-only file or directory. (<tt>f_unlink</tt>)</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. (<tt>f_read</tt>)</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. (<tt>f_open, f_mkdir</tt>)</li>
|
||||
<li>Could not find a contiguous data area for the file. (<tt>f_expand</tt>)</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<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>
|
||||
<dd>The file/directory object is invalid or a null pointer is given. 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>
|
||||
<li>It has been closed, or the structure has been collapsed.</li>
|
||||
<li>It has been invalidated. Open objects on the volume are invalidated by voulme mount process.</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>Physical drive is not ready to work due to a media removal.</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
@@ -113,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>
|
||||
|
||||
<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>
|
||||
<dd>Not enough memory for the operation. There is one of the following reasons:
|
||||
<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>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>
|
||||
</dd>
|
||||
|
||||
@@ -130,6 +129,7 @@ Note that if once this error occured in the operation to an open file, the file
|
||||
<dd>The given parameter is invalid or there is an inconsistent for the volume.</dd>
|
||||
</dl>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/read.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_read</title>
|
||||
</head>
|
||||
@@ -28,13 +26,13 @@ FRESULT f_read (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the open file object.</dd>
|
||||
<dd>Pointer to the open file object structure. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>buff</dt>
|
||||
<dd>Pointer to the buffer to store the read data.</dd>
|
||||
<dt>btr</dt>
|
||||
<dd>Number of bytes to read in range of <tt>UINT</tt> type. If the file needs to be read fast, it should be read in large chunk as possible.</dd>
|
||||
<dt>br</dt>
|
||||
<dd>Pointer to the <tt>UINT</tt> variable that receives number of bytes read. This value is always valid after the function call regardless of the function return code. If the return value is equal to <tt class="arg">btr</tt>, the function return code should be <tt>FR_OK</tt>.</dd>
|
||||
<dd>Pointer to the variable in <tt>UINT</tt> type that receives number of bytes read. This value is always valid after the function call regardless of the function return code. If the return value is equal to <tt class="arg">btr</tt>, the function return code should be <tt>FR_OK</tt>.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +52,7 @@ FRESULT f_read (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The function starts to read data from the file at the file offset pointed by read/write pointer. The read/write pointer advances as number of bytes read. After the function succeeded, <tt class="arg">*br</tt> should be checked to detect end of the file. In case of <tt class="arg">*br</tt> < <tt class="arg">btr</tt>, it means the read/write pointer hit end of the file during read operation.</p>
|
||||
<p>The function starts to read data from the file at the file offset pointed by read/write pointer of the file object. The read/write pointer advances as number of bytes read. After the function succeeded, <tt class="arg">*br</tt> should be checked to detect end of the file. In case of <tt class="arg">*br</tt> < <tt class="arg">btr</tt>, it means the read/write pointer hit end of the file during read operation.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -75,6 +73,7 @@ FRESULT f_read (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+52
-18
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/readdir.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_readdir</title>
|
||||
</head>
|
||||
@@ -53,19 +51,19 @@ FRESULT f_rewinddir (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The <tt>f_readdir</tt> function reads a directory item, informations about the object, from the open directory. Items in the directory can be read in sequence by <tt>f_readdir</tt> function calls. When all items in the directory have been read and no item to read, a null string is stored into the <tt>fno->fname[]</tt> without any error. When a null pointer is given to the <tt class="arg">fno</tt>, the read index of the directory object is rewinded. The <tt>f_rewinddir</tt> function is implemented as a macro.</p>
|
||||
<p>The <tt>f_readdir</tt> function reads a directory item, informations about the object, from the open directory. Items in the directory can be read by <tt>f_readdir</tt> function calls in order of the directory table. When all items in the directory have been read and no item to read any more, a null string in <tt>fno->fname[]</tt> will be returned without an error. If a null pointer is given to the <tt class="arg">fno</tt>, the read index of the directory object will be rewound. The <tt>f_rewinddir</tt> function is implemented as a macro.</p>
|
||||
<pre>
|
||||
#define <em>f_rewinddir</em>(dp) f_readdir((dp), 0)
|
||||
</pre>
|
||||
<p>When LFN is enabled, a member <tt>altname[]</tt> is defined in the file information structure to store the short file name of the object. If the long file name is not accessible due to a reason listed below, short file name is stored to the <tt>fname[]</tt> and the <tt>altname[]</tt> has a null string.</p>
|
||||
<p>When LFN is enabled, a member <tt>altname[]</tt> is defined in the file information structure to store the short file name of the object. If the long file name is not accessible due to any reason listed below, short file name is stored to the <tt>fname[]</tt> and the <tt>altname[]</tt> has a null string.</p>
|
||||
<ul>
|
||||
<li>The item has no LFN. (Not the case in exFAT volume)</li>
|
||||
<li><a href="config.html#max_lfn"><tt>FF_MAX_LFN</tt></a> is insufficient to handle the LFN. (Not the case in <tt>FF_MAX_LFN == 255</tt>)</li>
|
||||
<li>The item has no LFN. (Not the case on the exFAT volume)</li>
|
||||
<li><a href="config.html#max_lfn"><tt>FF_MAX_LFN</tt></a> is insufficient to handle the LFN. (Not the case when <tt>FF_MAX_LFN == 255</tt>)</li>
|
||||
<li><a href="config.html#lfn_buf"><tt>FF_LFN_BUF</tt></a> is insufficient to store the LFN.</li>
|
||||
<li>The LFN contains some character not defined in current CP. (Not the case in <tt>FF_LFN_UNICODE != 0</tt>)</li>
|
||||
<li>The LFN contains some character not defined in current CP. (Not the case when <tt>FF_LFN_UNICODE != 0</tt>)</li>
|
||||
</ul>
|
||||
<p>There is an issue on read directories in exFAT volume. The exFAT does not support short file name. This means no name can be returned on the condition above. If it is the case, "?" is returned as the file name to indicate that the object is not accessible. To avoid this problem, configure FatFs <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> != 0</tt> and <tt>FF_MAX_LFN == 255</tt> to support the full feature of LFN specification.</p>
|
||||
<p>Dot entries (<tt>"."</tt> and <tt>".."</tt>) in the sub-directory of FAT volume are filtered out and they will never appear in the read items because exFAT lacks dot entries in the sub-directory.</p>
|
||||
<p>There is an issue on read the directories on the exFAT volume. The exFAT does not support short file name. This means no name can be returned on the condition above. If it is the case, "?" is returned as the file name to indicate that the object is not accessible. To avoid this problem, configure FatFs <tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> != 0</tt> and <tt>FF_MAX_LFN == 255</tt> to support the full feature of LFN specification.</p>
|
||||
<p>Dot entries (<tt>"."</tt> and <tt>".."</tt>) in the sub-directory of FAT volume are filtered out and they will never appear in the read items because of the consistency with exFAT which lacks dot entries in the sub-directory.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -78,6 +76,41 @@ FRESULT f_rewinddir (
|
||||
<div class="para use">
|
||||
<h4>Sample Code</h4>
|
||||
<pre>
|
||||
<span class="c">/* List contents of a directory */</span>
|
||||
|
||||
FRESULT list_dir (const char *path)
|
||||
{
|
||||
FRESULT res;
|
||||
DIR dir;
|
||||
FILINFO fno;
|
||||
int nfile, ndir;
|
||||
|
||||
|
||||
res = <em>f_opendir</em>(&dir, path); <span class="c">/* Open the directory */</span>
|
||||
if (res == FR_OK) {
|
||||
nfile = ndir = 0;
|
||||
for (;;) {
|
||||
res = <em>f_readdir</em>(&dir, &fno); <span class="c">/* Read a directory item */</span>
|
||||
if (fno.fname[0] == 0) break; <span class="c">/* Error or end of dir */</span>
|
||||
if (fno.fattrib & AM_DIR) { <span class="c">/* It is a directory */</span>
|
||||
printf(" <DIR> %s\n", fno.fname);
|
||||
ndir++;
|
||||
} else { <span class="c">/* It is a file */</span>
|
||||
printf("%10u %s\n", fno.fsize, fno.fname);
|
||||
nfile++;
|
||||
}
|
||||
}
|
||||
<em>f_closedir</em>(&dir);
|
||||
printf("%d dirs, %d files.\n", ndir, nfile);
|
||||
} else {
|
||||
printf("Failed to open \"%s\". (%u)\n", path, res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
</pre>
|
||||
<pre>
|
||||
<span class="c">/* Recursive scan of all items in the directory */</span>
|
||||
|
||||
FRESULT scan_files (
|
||||
char* path <span class="c">/* Start node to be scanned (***also used as work area***) */</span>
|
||||
)
|
||||
@@ -88,22 +121,22 @@ FRESULT scan_files (
|
||||
static FILINFO fno;
|
||||
|
||||
|
||||
res = f_opendir(&dir, path); <span class="c">/* Open the directory */</span>
|
||||
res = <em>f_opendir</em>(&dir, path); <span class="c">/* Open the directory */</span>
|
||||
if (res == FR_OK) {
|
||||
for (;;) {
|
||||
res = <em>f_readdir</em>(&dir, &fno); <span class="c">/* Read a directory item */</span>
|
||||
if (res != FR_OK || fno.fname[0] == 0) break; <span class="c">/* Break on error or end of dir */</span>
|
||||
if (fno.fattrib & AM_DIR) { <span class="c">/* It is a directory */</span>
|
||||
res = <em>f_readdir</em>(&dir, &fno); <span class="c">/* Read a directory item */</span>
|
||||
if (fno.fname[0] == 0) break; <span class="c">/* Break on error or end of dir */</span>
|
||||
if (fno.fattrib & AM_DIR) { <span class="c">/* The item is a directory */</span>
|
||||
i = strlen(path);
|
||||
sprintf(&path[i], "/%s", fno.fname);
|
||||
res = scan_files(path); <span class="c">/* Enter the directory */</span>
|
||||
res = scan_files(path); <span class="c">/* Enter the directory */</span>
|
||||
if (res != FR_OK) break;
|
||||
path[i] = 0;
|
||||
} else { <span class="c">/* It is a file. */</span>
|
||||
} else { <span class="c">/* The item is a file. */</span>
|
||||
printf("%s/%s\n", path, fno.fname);
|
||||
}
|
||||
}
|
||||
f_closedir(&dir);
|
||||
<em>f_closedir</em>(&dir);
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -117,7 +150,7 @@ int main (void)
|
||||
char buff[256];
|
||||
|
||||
|
||||
res = f_mount(&fs, "", 1);
|
||||
res = <em>f_mount</em>(&fs, "", 1);
|
||||
if (res == FR_OK) {
|
||||
strcpy(buff, "/");
|
||||
res = scan_files(buff);
|
||||
@@ -134,6 +167,7 @@ int main (void)
|
||||
<p><tt><a href="opendir.html">f_opendir</a>, <a href="closedir.html">f_closedir</a>, <a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a>, <a href="sdir.html">DIR</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/rename.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_rename</title>
|
||||
</head>
|
||||
@@ -26,9 +24,9 @@ FRESULT f_rename (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -57,7 +55,9 @@ FRESULT f_rename (
|
||||
|
||||
<div class="para desc">
|
||||
<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>
|
||||
|
||||
|
||||
@@ -76,12 +76,12 @@ FRESULT f_rename (
|
||||
<span class="c">/* Rename an object in the drive 2 */</span>
|
||||
<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");
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sdir.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - DIR</title>
|
||||
</head>
|
||||
@@ -16,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>
|
||||
<pre>
|
||||
<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 clust; <span class="c">/* Current cluster */</span>
|
||||
LBA_t sect; <span class="c">/* Current sector */</span>
|
||||
@@ -27,12 +25,13 @@
|
||||
WCHAR* lfn; <span class="c">/* Pointer to the LFN working buffer (in/out) */</span>
|
||||
<span class="k">#endif</span>
|
||||
<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>
|
||||
} DIR;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getcwd.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_setcp</title>
|
||||
</head>
|
||||
@@ -77,6 +75,6 @@ FRESULT f_setcp (
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/setlabel.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_setlabel</title>
|
||||
</head>
|
||||
@@ -25,7 +23,7 @@ FRESULT f_setlabel (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>label</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies the volume label to be set.</dd>
|
||||
<dd>Pointer to the null-terminated string that specifies the volume label to be set. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -49,7 +47,7 @@ FRESULT f_setlabel (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>When the string has a drive prefix, the volume label will be set to the volume specified by the drive prefix. Unix style volume ID cannot be used to specify the volume. If drive number is not specified, the volume label will be set to the default drive. If length of the given volume label is zero, the volume label on the volume will be removed. The format of the volume label is as shown below:</p>
|
||||
<p>When the string has a drive prefix, the volume label will be set to the volume specified by the drive prefix. If drive number is not specified, the volume label will be set to the default drive. If length of the given volume label is zero, the volume label on the volume will be removed. The format of the volume label is as shown below:</p>
|
||||
<ul>
|
||||
<li>Up to 11 bytes long as conversion of OEM code page at FAT volume.</li>
|
||||
<li>Up to 11 characters long at exFAT volume.</li>
|
||||
@@ -57,7 +55,7 @@ FRESULT f_setlabel (
|
||||
<li>Allowable characters for exFAT volume are: characters allowed for LFN includes dot. Low-case characters are preserved.</li>
|
||||
<li>Spaces can be embedded anywhere in the volume label. Trailing spaces are truncated off at FAT volume.</li>
|
||||
</ul>
|
||||
<p>Remark: The standard system (Windows) has a problem at the volume label with a heading <tt>\xE5</tt> on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.</p>
|
||||
<p>Remark: The standard system (Windows) has a problem in the volume label with a heading <tt>\xE5</tt> on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.</p>
|
||||
</div>
|
||||
|
||||
<div class="para comp">
|
||||
@@ -77,6 +75,9 @@ FRESULT f_setlabel (
|
||||
|
||||
<span class="c">/* Remove volume label of the drive 2 */</span>
|
||||
<em>f_setlabel</em>("2:");
|
||||
|
||||
<span class="c">/* Set volume label in Unix style volume id */</span>
|
||||
<em>f_setlabel</em>("/tfcard/LOG DISK");
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -87,6 +88,6 @@ FRESULT f_setlabel (
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+16
-17
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfatfs.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - FATFS</title>
|
||||
</head>
|
||||
@@ -17,7 +15,8 @@
|
||||
<pre>
|
||||
<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 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 wflag; <span class="c">/* win[] flag (b0:win[] is dirty) */</span>
|
||||
BYTE fsi_flag; <span class="c">/* FSINFO flags (b7:Disabled, b0:Dirty) */</span>
|
||||
@@ -27,36 +26,36 @@
|
||||
<span class="k">#if</span> FF_MAX_SS != FF_MIN_SS
|
||||
WORD ssize; <span class="c">/* Sector size (512,1024,2048 or 4096) */</span>
|
||||
<span class="k">#endif</span>
|
||||
<span class="k">#if</span> FF_FS_EXFAT
|
||||
BYTE* dirbuf; <span class="c">/* Directory entry block scratchpad 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">#if</span> FF_USE_LFN
|
||||
WCHAR* lfnbuf; <span class="c">/* Pointer to LFN working buffer */</span>
|
||||
<span class="k">#endif</span>
|
||||
<span class="k">#if</span> !FF_FS_READONLY
|
||||
DWORD last_clust; <span class="c">/* FSINFO: Last allocated cluster (0xFFFFFFFF if invalid) */</span>
|
||||
DWORD free_clust; <span class="c">/* FSINFO: Number of free clusters (0xFFFFFFFF if invalid) */</span>
|
||||
DWORD last_clust; <span class="c">/* FSINFO: Last allocated cluster (invalid if >=n_fatent) */</span>
|
||||
DWORD free_clust; <span class="c">/* FSINFO: Number of free clusters (invalid if >=fs->n_fatent-2) */</span>
|
||||
<span class="k">#endif</span>
|
||||
<span class="k">#if</span> FF_FS_RPATH
|
||||
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>
|
||||
DWORD n_fatent; <span class="c">/* Number of FAT entries (Number of clusters + 2) */</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 fatbase; <span class="c">/* FAT base LBA */</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 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>
|
||||
} FATFS;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfile.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - FIL</title>
|
||||
</head>
|
||||
@@ -17,18 +15,18 @@
|
||||
|
||||
<pre>
|
||||
<span class="k">typedef</span> <span class="k">struct</span> {
|
||||
FFOBJID obj; <span class="c">/* Object identifier */</span>
|
||||
BYTE flag; <span class="c">/* File object status flags */</span>
|
||||
<a href="sobjid.html">FFOBJID</a> obj; <span class="c">/* Object identifier */</span>
|
||||
BYTE flag; <span class="c">/* File status flags */</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>
|
||||
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>
|
||||
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>
|
||||
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
|
||||
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">#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">#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>
|
||||
@@ -38,6 +36,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfileinfo.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - FILINFO</title>
|
||||
</head>
|
||||
@@ -16,10 +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>
|
||||
<pre>
|
||||
<span class="k">typedef struct</span> {
|
||||
FSIZE_t fsize; <span class="c">/* File size */</span>
|
||||
WORD fdate; <span class="c">/* Last modified date */</span>
|
||||
WORD ftime; <span class="c">/* Last modified time */</span>
|
||||
BYTE fattrib; <span class="c">/* Attribute */</span>
|
||||
FSIZE_t fsize; <span class="c">/* File size (invalid for directory) */</span>
|
||||
WORD fdate; <span class="c">/* Date of file modification or directory creation */</span>
|
||||
WORD ftime; <span class="c">/* Time of file modification or directory creation */</span>
|
||||
<span class="k">#if</span> FF_FS_CRTIME
|
||||
WORD crdate; <span class="c">/* Date of object createion */</span>
|
||||
WORD crtime; <span class="c">/* Time of object createion */</span>
|
||||
<span class="k">#endif</span>
|
||||
BYTE fattrib; <span class="c">/* Object attribute */</span>
|
||||
<span class="k">#if</span> FF_USE_LFN
|
||||
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>
|
||||
@@ -56,6 +58,12 @@
|
||||
<dd>Second / 2 (0..29)</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>crdate</dt>
|
||||
<dd>The date when the file/directory was created. This member is available when <tt><a href="config.html#fs_ctime">FF_FS_CRTIME</a> = 1</tt>.
|
||||
</dd>
|
||||
<dt>crtime</dt>
|
||||
<dd>The time when the file/directory was created. This member is available when <tt>FF_FS_CRTIME = 1</tt>
|
||||
</dd>
|
||||
<dt>fattrib</dt>
|
||||
<dd>The attribute flags in combination of:<br>
|
||||
<table class="lst">
|
||||
@@ -68,11 +76,12 @@
|
||||
</table>
|
||||
</dd>
|
||||
<dt>fname[]</dt>
|
||||
<dd>Null-terminated object name. A null string is stored when no item to read and it indicates this structure is invalid. The size of <tt>fname[]</tt> and <tt>altname[]</tt> each can be configured in LFN configuration.</dd>
|
||||
<dd>Null-terminated object name is stored. If no item to read or an error occured in the function, a null string is stored to indicate this structure is invalid. The size of <tt>fname[]</tt> and <tt>altname[]</tt> each can be configured in LFN configuration.</dd>
|
||||
<dt>altname[]</dt>
|
||||
<dd>Alternative object name is stored if available. This member is not available in non-LFN configuration.</dd>
|
||||
</dl>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/size.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_size</title>
|
||||
</head>
|
||||
@@ -57,6 +55,7 @@ FSIZE_t f_size (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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>
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/stat.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_stat</title>
|
||||
</head>
|
||||
@@ -26,7 +24,7 @@ FRESULT f_stat (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">object</a> to get its information. The object must not be the root direcotry.</dd>
|
||||
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">object</a> to get its information. The object must not be the root direcotry. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
|
||||
<dt>fno</dt>
|
||||
<dd>Pointer to the blank <tt>FILINFO</tt> structure to store the information of the object. Set null pointer if this information is not needed.</dd>
|
||||
</dl>
|
||||
@@ -54,8 +52,8 @@ FRESULT f_stat (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The <tt>f_stat</tt> function checks the existence of a file or sub-directory in the directory. If it is not exist, the function returns with <tt>FR_NO_FILE</tt>. If it is exist, the function returns with <tt>FR_OK</tt> and the informations about the object, size, timestamp and attribute, is stored to the file information structure. For details of the file information, refer to the <tt>FILINFO</tt> structure and <a href="readdir.html"><tt>f_readdir</tt></a> function.</p>
|
||||
<p>Note that the file information comes from the meta data in the directory. If the file has been opend and modified, the file will need to be synched or closed in order to obtain the latest file information.</p>
|
||||
<p>The <tt>f_stat</tt> function checks the existence of a file or sub-directory. If it is not exist, the function returns with <tt>FR_NO_FILE</tt>. If it is exist, the function returns with <tt>FR_OK</tt> and the informations about the object, size, timestamp and attribute, is stored to the file information structure. For details of the file information, refer to the <tt>FILINFO</tt> structure and <a href="readdir.html"><tt>f_readdir</tt></a> function.</p>
|
||||
<p>Note that the file information comes from the meta data in the directory. If the file has been opend and modified, the file will need to be synced or closed in order to obtain the latest file information. This function cannot be used to retrieve the long file name with the short file name.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -92,6 +90,7 @@ FRESULT f_stat (
|
||||
break;
|
||||
|
||||
case FR_NO_FILE:
|
||||
case FR_NO_PATH:
|
||||
printf("\"%s\" is not exist.\n", fname);
|
||||
break;
|
||||
|
||||
@@ -103,10 +102,11 @@ FRESULT f_stat (
|
||||
|
||||
|
||||
<div class="para ref">
|
||||
<h4>References</h4>
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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 && 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>
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sync.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_sync</title>
|
||||
</head>
|
||||
@@ -68,7 +66,7 @@ C - f_close()
|
||||
w - f_write()
|
||||
S - f_sync()
|
||||
</pre>
|
||||
<p>However there is no sense in <tt>f_sync</tt> function immediataly before <tt>f_close</tt> function because it performs <tt>f_sync</tt> function in it. In other words, the differnce between those functions is that the file object is invalidated or not.</p>
|
||||
<p>However there is no sense in <tt>f_sync</tt> function jsut before <tt>f_close</tt> function, because the <tt>f_close</tt> performs <tt>f_sync</tt> in it. Actually, the differnce between these functions is that the file object is invalidated or not.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -83,6 +81,7 @@ S - f_sync()
|
||||
<p><tt><a href="close.html">f_close</a></tt>, <a href="appnote.html#critical">Critical section</a></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/tell.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_tell</title>
|
||||
</head>
|
||||
@@ -57,6 +55,7 @@ FSIZE_t f_tell (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/truncate.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_truncate</title>
|
||||
</head>
|
||||
@@ -25,7 +23,7 @@ FRESULT f_truncate (
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the open file object to be truncated.</dd>
|
||||
<dd>Pointer to the open file object to be truncated. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -61,6 +59,6 @@ FRESULT f_truncate (
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/unlink.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_unlink</title>
|
||||
</head>
|
||||
@@ -25,7 +23,7 @@ FRESULT f_unlink (
|
||||
<h4>Parameter</h4>
|
||||
<dl class="par">
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to a null-terminated string that specifies the <a href="filename.html">file or sub-directory</a> to be removed.</dd>
|
||||
<dd>Pointer to a null-terminated string that specifies the <a href="filename.html">file or sub-directory</a> to be removed. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -69,6 +67,6 @@ If condition of the object to be removed is applicable to the following terms, t
|
||||
</div>
|
||||
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/utime.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_utime</title>
|
||||
</head>
|
||||
@@ -17,7 +15,7 @@
|
||||
<pre>
|
||||
FRESULT f_utime (
|
||||
const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Object name */</span>
|
||||
const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] Time and data to be set */</span>
|
||||
const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] Time and date to be set */</span>
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
@@ -26,9 +24,9 @@ FRESULT f_utime (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed.</dd>
|
||||
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
|
||||
<dt>fno</dt>
|
||||
<dd>Pointer to the file information structure that has a timestamp to be set in member fdate and ftime. Do not care any other members.</dd>
|
||||
<dd>Pointer to the file information structure that has new timestamps to be set in the members. <tt>fdate</tt> and <tt>ftime</tt> are for the last modified time. When <tt><a href="config.html#fs_ctime">FF_FS_CRTIME</a> = 1</tt>, <tt>crdate</tt> and <tt>crtime</tt> for the created time are available in addition. Every timestamp is in local time. If <tt>fdate</tt> or <tt>crdate</tt> is invalid (0), the modified time or created time is left unchanged respectively. Do not care any other member.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -63,7 +61,7 @@ FRESULT f_utime (
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
FRESULT set_timestamp (
|
||||
char *obj, <span class="c">/* Pointer to the file name */</span>
|
||||
const char *fname, <span class="c">/* Pointer to the file name */</span>
|
||||
int year,
|
||||
int month,
|
||||
int mday,
|
||||
@@ -76,8 +74,10 @@ FRESULT set_timestamp (
|
||||
|
||||
fno.fdate = (WORD)(((year - 1980) * 512U) | month * 32U | mday);
|
||||
fno.ftime = (WORD)(hour * 2048U | min * 32U | sec / 2U);
|
||||
|
||||
return <em>f_utime</em>(obj, &fno);
|
||||
<span class="k">#if</span> FF_FS_CRTIME
|
||||
fno.crdate = 0; <span class="c">/* Do not change created time in this code */</span>
|
||||
<span class="k">#endif</span>
|
||||
return <em>f_utime</em>(fname, &fno);
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
@@ -94,6 +94,7 @@ FRESULT set_timestamp (
|
||||
<p><tt><a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/write.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_write</title>
|
||||
</head>
|
||||
@@ -28,13 +26,13 @@ FRESULT f_write (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>fp</dt>
|
||||
<dd>Pointer to the open file object structure.</dd>
|
||||
<dd>Pointer to the open file object structure. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>buff</dt>
|
||||
<dd>Pointer to the data to be written.</dd>
|
||||
<dt>btw</dt>
|
||||
<dd>Specifies number of bytes to write in range of <tt>UINT</tt> type. If the data needs to be written fast, it should be written in large chunk as possible.</dd>
|
||||
<dt>bw</dt>
|
||||
<dd>Pointer to the <tt>UINT</tt> variable that receives the number of bytes written. This value is always valid after the function call regardless of the function return code. If the return value is equal to <tt class="arg">btw</tt>, the function return code should be <tt>FR_OK</tt>.</dd>
|
||||
<dd>Pointer to the variable in <tt>UINT</tt> type that receives the number of bytes written. This value is always valid after the function call regardless of the function return code. If the return value is equal to <tt class="arg">btw</tt>, the function return code should be <tt>FR_OK</tt>.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +52,7 @@ FRESULT f_write (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The function starts to write data to the file at the file offset pointed by read/write pointer. The read/write pointer advances as number of bytes written. After the function succeeded, <tt class="arg">*bw</tt> should be checked to detect the disk full. In case of <tt class="arg">*bw</tt> < <tt class="arg">btw</tt>, it means the volume got full during the write operation. The function can take a time when the volume is full or close to full.</p>
|
||||
<p>The function starts to write data to the file at the file offset pointed by read/write pointer of the file object. The read/write pointer advances as number of bytes written. After the function succeeded, <tt class="arg">*bw</tt> should be checked to detect the disk full. In case of <tt class="arg">*bw</tt> < <tt class="arg">btw</tt>, it means the volume got full during the write operation. The function can take a time when the volume is full or close to full.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -75,6 +73,7 @@ FRESULT f_write (
|
||||
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">fputc</a>, <a href="puts.html">fputs</a>, <a href="printf.html">fprintf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
|
||||
</div>
|
||||
|
||||
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
||||
|
||||
<p class="foot"><a href="../index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
<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 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">
|
||||
<title>FatFs - Generic FAT Filesystem Module</title>
|
||||
</head>
|
||||
@@ -17,7 +14,7 @@
|
||||
|
||||
<div class="abst">
|
||||
<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 I/O layer. Therefore it is independent of the platform. 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="http://elm-chan.org/fsw/ff/00index_p.html">here</a>.</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>
|
||||
<ul>
|
||||
@@ -105,7 +102,7 @@
|
||||
<div class="para">
|
||||
<h3>Media Access Interface</h3>
|
||||
<img src="res/layers2.png" class="rset" width="245" height="220" alt="layer">
|
||||
<p>Since FatFs module is the <em>Filesystem Layer</em> independent of platforms and storage media, it is completely separated from the physical devices, such as memory card, harddisk and any type of storage device. The storage device control module is <em>not any part of FatFs module</em> and it needs to be provided by implementer. FatFs controls the storage devices via a simple media access interface shown below. Also sample implementations for some platforms are available in the downloads. A function checker for storage device control module is available <a href="res/app4.c">here</a>.</p>
|
||||
<p>Since FatFs module is the <em>Filesystem Layer</em> independent of platforms and storage media, it is completely separated from the physical devices, such as memory card, harddisk and any type of storage device. The storage device control module is <em>not a part of FatFs module</em> and it needs to be provided by implementer. FatFs controls the storage devices via a simple media access interface shown below. Also sample implementations for some platforms are available in the downloads. A function checker for storage device control module is available <a href="res/app4.c">here</a>.</p>
|
||||
<ul>
|
||||
<li>Storage Device Controls
|
||||
<ul>
|
||||
@@ -130,20 +127,19 @@
|
||||
<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>
|
||||
<li><em>Getting Started: <a href="doc/appnote.html">FatFs Application Note</a></em></li>
|
||||
<li>Community: <a href="http://elm-chan.org/fsw/ff/bd/">FatFs User Forum</a></li>
|
||||
<li><a href="https://msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx">FAT32 Specification by Microsoft</a>↗ (The authorized document on FAT filesystem)</li>
|
||||
<li><a href="http://elm-chan.org/docs/fat_e.html">The basics of FAT filesystem</a> (FatFs is written based on this documentation)</li>
|
||||
<li><a href="http://elm-chan.org/docs/exfat_e.html">The basics of exFAT filesystem</a> (FatFs is written based on this documentation)</li>
|
||||
<li><a href="http://elm-chan.org/docs/mmc/mmc_e.html">How to use MMC/SDC</a></li>
|
||||
<li><a href="http://elm-chan.org/junk/fa/faff.html">Playing with FlashAir and FatFs</a></li>
|
||||
<li><a href="http://nemuisan.blog.bai.ne.jp/">Nemuisan's Blog</a>↗ (Well written implementations for STM32F/SPI & SDIO and LPC4088/SDMMC)</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>↗ (Quick and easy implementation for STM32F4-Discovery)</li>
|
||||
<li><a href="res/rwtest1.png">Benchmark 1</a> (ATmega1284/20MHz with MMC via USART in SPI, CFC via GPIO)</li>
|
||||
<li><a href="res/rwtest2.png">Benchmark 2</a> (LPC2368/72MHz with MMC via MCI)</li>
|
||||
<li>Downloads: <a href="https://elm-chan.org/fsw/ff/archives.html">Latest Releases</a><span class="lnk">🔗</span></li>
|
||||
<li>Community: <a href="https://elm-chan.org/fsw/ff/bd/">FatFs User Forum</a><span class="lnk">🔗</span></li>
|
||||
<li><a href="https://msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx">FAT32 Specification by Microsoft</a><span class="lnk">🔗</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">🔗</span> (FatFs is written based on this documentation)</li>
|
||||
<li><a href="https://elm-chan.org/docs/exfat_e.html">The basics of exFAT filesystem</a><span class="lnk">🔗</span> (FatFs is written based on this documentation)</li>
|
||||
<li><a href="https://elm-chan.org/docs/mmc/mmc_e.html">How to use MMC/SDC</a><span class="lnk">🔗</span></li>
|
||||
<li><a href="https://elm-chan.org/junk/fa/faff.html">Playing with FlashAir and FatFs</a><span class="lnk">🔗</span></li>
|
||||
<li><a href="https://nemuisan.blog.bai.ne.jp/">Nemuisan's Blog</a><span class="lnk">🔗</span> (Well written implementations for STM32F/SPI & SDIO and LPC4088/SDMMC)</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">🔗</span> (Quick and easy implementation for STM32F4-Discovery)</li>
|
||||
</div>
|
||||
|
||||
|
||||
<hr>
|
||||
<p class="foot"><a href="../../fsw_e.html">Return</a></p>
|
||||
<p class="foot"><a href="https://elm-chan.org/fsw/ff/">Home Page</a></p>
|
||||
</body>
|
||||
</html>
|
||||
+401
-193
@@ -4,476 +4,684 @@
|
||||
<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">
|
||||
<link rel="start" title="Site Top" href="../../">
|
||||
<link rel="stylesheet" href="css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - Known Problems</title>
|
||||
<title>FatFs - Updates and Migration Notes</title>
|
||||
</head>
|
||||
<body style="max-width: none;">
|
||||
<h2>Updates and Migration Notes</h2>
|
||||
<table class="lst4">
|
||||
|
||||
<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>
|
||||
<td>R0.15b<br>Jun 21, 2025</td>
|
||||
<td>
|
||||
<ul class="plain">
|
||||
<li>Added support for the timestamp of created time. (<tt>FF_FS_CRTIME</tt>)</li>
|
||||
<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>
|
||||
<ul class="plain">
|
||||
<li>Small changes to the <tt>f_utime</tt> function to support for the timestamp of created time.</li>
|
||||
</ul></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.15a<br>Nov 22, 2024</td>
|
||||
<td>
|
||||
<ul class="plain">
|
||||
<li>Fixed a complie error when <tt>FF_FS_LOCK != 0</tt>. (appeared at R0.15)</li>
|
||||
<li>Fixed a potential issue when work FatFs concurrency with <tt>FF_FS_REENTRANT</tt>, <tt>FF_VOLUMES >= 2</tt> and <tt>FF_FS_LOCK > 0</tt>.</li>
|
||||
<li>Made <tt>f_setlabel</tt> accept a volume label with Unix style volume ID when <tt>FF_STR_VOLUME_ID == 2</tt>.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.15<br>Nov 6, 2022</td>
|
||||
<td>
|
||||
Changed user provided synchronization functions in order to completely eliminate the platform dependency from FatFs code.<br>
|
||||
Fixed a potential error in <tt>f_mount</tt> when <tt>FF_FS_REENTRANT</tt>.<br>
|
||||
Fixed file lock control <tt>FF_FS_LOCK</tt> is not mutal excluded when <tt>FF_FS_REENTRANT && FF_VOLUMES > 1</tt> is true.<br>
|
||||
Fixed <tt>f_mkfs</tt> creates broken exFAT volume when the size of volume is <tt>>= 2^32</tt> sectors.<br>
|
||||
Fixed string functions cannot write the unicode characters not in BMP when <tt>FF_LFN_UNICODE == 2</tt> (UTF-8).<br>
|
||||
Fixed a compatibility issue in identification of GPT header.<br>
|
||||
</td>
|
||||
<ul class="plain">
|
||||
<li>Changed user provided synchronization functions in order to completely eliminate the platform dependency from FatFs code.</li>
|
||||
<li>Fixed a potential error in <tt>f_mount</tt> when <tt>FF_FS_REENTRANT</tt>.</li>
|
||||
<li>Fixed file lock control <tt>FF_FS_LOCK</tt> is not mutal excluded when <tt>FF_FS_REENTRANT && FF_VOLUMES > 1</tt> is true.</li>
|
||||
<li>Fixed <tt>f_mkfs</tt> creates broken exFAT volume when the size of volume is <tt>>= 2^32</tt> sectors.</li>
|
||||
<li>Fixed string functions cannot write the unicode characters not in BMP when <tt>FF_LFN_UNICODE == 2</tt> (UTF-8).</li>
|
||||
<li>Fixed a compatibility issue in identification of GPT header.</li>
|
||||
</ul></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 by <tt>ff_mutex_create</tt>, <tt>ff_mutex_delete</tt>, <tt>ff_mutex_take</tt> and <tt>ff_mutex_give</tt> respectively. For examples, see <tt>ffsystem.c</tt>.<br>
|
||||
<tt>FF_SYNC_t</tt> is removed from the configuration options.<br>
|
||||
</td>
|
||||
<ul class="plain">
|
||||
<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>
|
||||
<li><tt>FF_SYNC_t</tt> is removed from the configuration options.</li>
|
||||
</ul></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.14b<br>Apr 17, 2021</td>
|
||||
<td>
|
||||
Made FatFs uses standard library <tt>string.h</tt> for copy, compare and search instead of built-in string functions.<br>
|
||||
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>
|
||||
Made path name parser ignores the terminating separator to allow <tt>"dir/"</tt>.<br>
|
||||
Improved the compatibility in Unix style path name feature.<br>
|
||||
Fixed the file gets dead-locked when <tt>f_open</tt> failed with certain conditions. (appeared at R0.12a)<br>
|
||||
Fixed <tt>f_mkfs</tt> can create wrong exFAT volume due to a timing dependent error. (appeared at R0.12)<br>
|
||||
Fixed code page 855 cannot be set by <tt>f_setcp</tt>. (appeared at R0.13)<br>
|
||||
Fixed some compiler warnings.<br>
|
||||
<ul class="plain">
|
||||
<li>Made FatFs uses standard library <tt>string.h</tt> for copy, compare and search instead of built-in string functions.</li>
|
||||
<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>
|
||||
<li>Made path name parser ignores the terminating separator to allow <tt>"dir/"</tt>.</li>
|
||||
<li>Improved the compatibility in Unix style path name feature.</li>
|
||||
<li>Fixed the file gets dead-locked when <tt>f_open</tt> failed with certain conditions. (appeared at R0.12a)</li>
|
||||
<li>Fixed <tt>f_mkfs</tt> can create wrong exFAT volume due to a timing dependent error. (appeared at R0.12)</li>
|
||||
<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>
|
||||
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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.14a<br>Dec 05, 2020</td>
|
||||
<td>
|
||||
Limited number of recursive calls in <tt>f_findnext</tt> to prevent stack overflow.<br>
|
||||
Fixed old floppy disks formatted with MS-DOS 2.x and 3.x cannot be mounted.<br>
|
||||
Fixed some compiler warnings.<br>
|
||||
<ul class="plain">
|
||||
<li>Limited number of recursive calls in <tt>f_findnext</tt> to prevent stack overflow.</li>
|
||||
<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>
|
||||
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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.14<br>Oct 14, 2019</td>
|
||||
<td>
|
||||
Added support for 64-bit LBA and GUID partition table (<tt>FF_LBA64</tt>)<br>
|
||||
Changed some API functions, <tt>f_mkfs</tt> and <tt>f_fdisk</tt>.<br>
|
||||
Fixed <tt>f_open</tt> cannot find the file with file name in length of <tt>FF_MAX_LFN</tt> characters.<br>
|
||||
Fixed <tt>f_readdir</tt> cannot retrieve long file names in length of <tt>FF_MAX_LFN - 1</tt> characters.<br>
|
||||
Fixed <tt>f_readdir</tt> returns file names with wrong case conversion. (appeared at R0.12)<br>
|
||||
Fixed <tt>f_mkfs</tt> can fail to create exFAT volume in the second partition. (appeared at R0.12)<br>
|
||||
<ul class="plain">
|
||||
<li>Added support for 64-bit LBA and GUID partition table (<tt>FF_LBA64</tt>)</li>
|
||||
<li>Changed some API functions, <tt>f_mkfs</tt> and <tt>f_fdisk</tt>.</li>
|
||||
<li>Fixed <tt>f_open</tt> cannot find the file with file name in length of <tt>FF_MAX_LFN</tt> characters.</li>
|
||||
<li>Fixed <tt>f_readdir</tt> cannot retrieve long file names in length of <tt>FF_MAX_LFN - 1</tt> characters.</li>
|
||||
<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>
|
||||
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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.13c<br>Oct 14, 2018</td>
|
||||
<td>
|
||||
Supported <tt>stdint.h</tt> for C99 and later. (<tt>integer.h</tt> was included in <tt>ff.h</tt>)<br>
|
||||
Fixed reading a directory gets infinite loop when the last directory entry is not empty. (appeared at R0.12)<br>
|
||||
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>
|
||||
Fixed <tt>f_getcwd</tt> cause output buffer overrun when the buffer has a valid drive number. (appeared at R0.13b)<br>
|
||||
<ul class="plain">
|
||||
<li>Supported <tt>stdint.h</tt> for C99 and later. (<tt>integer.h</tt> was included in <tt>ff.h</tt>)</li>
|
||||
<li>Fixed reading a directory gets infinite loop when the last directory entry is not empty. (appeared at R0.12)</li>
|
||||
<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>
|
||||
From this revision, FatFs depends on <tt>stdint.h</tt> in C99 or later.<br>
|
||||
<tt>integer.h</tt> is removed.<br>
|
||||
<ul class="plain">
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.13b<br>Apr 07, 2018</td>
|
||||
<td>
|
||||
Added support for UTF-32 encoding on the API. (<tt>FF_LFN_UNICODE = 3</tt>)<br>
|
||||
Added support for Unix style volume prefix. (<tt>FF_STR_VOLUME_ID = 2</tt>)<br>
|
||||
Fixed accesing objects in the exFAT root directory beyond the cluster boundary can fail. (appeared at R0.12c)<br>
|
||||
Fixed <tt>f_setlabel</tt> does not reject some invalid characters. (appeared at R0.09b)<br>
|
||||
<ul class="plain">
|
||||
<li>Added support for UTF-32 encoding on the API. (<tt>FF_LFN_UNICODE = 3</tt>)</li>
|
||||
<li>Added support for Unix style volume prefix. (<tt>FF_STR_VOLUME_ID = 2</tt>)</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.13a<br>Oct 14, 2017</td>
|
||||
<td>
|
||||
Added support for UTF-8 encoding on the API. (<tt>FF_LFN_UNICODE = 2</tt>)<br>
|
||||
Added options for file name output buffer. (<tt>FF_LFN_BUF, FF_SFN_BUF</tt>)<br>
|
||||
Added dynamic memory allocation option for working buffer of <tt>f_mkfs</tt> and <tt>f_fdisk</tt>.<br>
|
||||
Fixed <tt>f_fdisk</tt> and <tt>f_mkfs</tt> create the partition table with wrong CHS parameters. (appeared at R0.09)<br>
|
||||
Fixed <tt>f_unlink</tt> can cause lost clusters at fragmented file on the exFAT volume. (appeared at R0.12c)<br>
|
||||
Fixed <tt>f_setlabel</tt> rejects some valid characters for exFAT volume. (appeared at R0.12)<br>
|
||||
<ul class="plain">
|
||||
<li>Added support for UTF-8 encoding on the API. (<tt>FF_LFN_UNICODE = 2</tt>)</li>
|
||||
<li>Added options for file name output buffer. (<tt>FF_LFN_BUF, FF_SFN_BUF</tt>)</li>
|
||||
<li>Added dynamic memory allocation option for working buffer of <tt>f_mkfs</tt> and <tt>f_fdisk</tt>.</li>
|
||||
<li>Fixed <tt>f_fdisk</tt> and <tt>f_mkfs</tt> create the partition table with wrong CHS parameters. (appeared at R0.09)</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.13<br>May 21, 2017</td>
|
||||
<td>
|
||||
Prefix of configuration item names are changed from <tt>"_"</tt> to <tt>"FF_"</tt>.<br>
|
||||
Added <tt>f_setcp</tt>, run-time code page configuration. (<tt>FF_CODE_PAGE = 0</tt>)<br>
|
||||
Improved cluster allocation time on stretch a deep buried cluster chain.<br>
|
||||
Improved processing time of <tt>f_mkdir</tt> with large cluster size by using <tt>FF_USE_LFN = 3</tt>.<br>
|
||||
Improved exFAT <tt>NoFatChain</tt> flag of the fragmented file to be set after it is truncated and got contiguous.<br>
|
||||
Fixed archive attribute is left not set when a file on the exFAT volume is renamed. (appeared at R0.12)<br>
|
||||
Fixed exFAT FAT entry can be collapsed when write or lseek operation to the existing file is done. (appeared at R0.12c)<br>
|
||||
Fixed creating a file can fail when a new cluster allocation to the exFAT directory occures. (appeared at R0.12c)<br>
|
||||
<ul class="plain">
|
||||
<li>Prefix of configuration item names are changed from <tt>"_"</tt> to <tt>"FF_"</tt>.</li>
|
||||
<li>Added <tt>f_setcp</tt>, run-time code page configuration. (<tt>FF_CODE_PAGE = 0</tt>)</li>
|
||||
<li>Improved cluster allocation time on stretch a deep buried cluster chain.</li>
|
||||
<li>Improved processing time of <tt>f_mkdir</tt> with large cluster size by using <tt>FF_USE_LFN = 3</tt>.</li>
|
||||
<li>Improved exFAT <tt>NoFatChain</tt> flag of the fragmented file to be set after it is truncated and got contiguous.</li>
|
||||
<li>Fixed archive attribute is left not set when a file on the exFAT volume is renamed. (appeared at R0.12)</li>
|
||||
<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>
|
||||
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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.12c<br>Mar 04, 2017</td>
|
||||
<td>
|
||||
Improved write throughput at the fragmented file on the exFAT volume.<br>
|
||||
Made memory usage for exFAT be able to be reduced as decreasing <tt>_MAX_LFN</tt>.<br>
|
||||
Fixed successive <tt>f_getfree</tt> can return wrong count on the FAT12/16 volume. (appeared at R0.12)<br>
|
||||
Fixed configuration option <tt>_VOLUMES</tt> cannot be set 10. (appeared at R0.10c)<br>
|
||||
<ul class="plain">
|
||||
<li>Improved write throughput at the fragmented file on the exFAT volume.</li>
|
||||
<li>Made memory usage for exFAT be able to be reduced as decreasing <tt>_MAX_LFN</tt>.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.12b<br>Sep 4, 2016</td>
|
||||
<td>
|
||||
Made <tt>f_rename</tt> be able to rename objects with the same name but case.<br>
|
||||
Fixed an error in the case conversion teble of code page 866. (<tt>ff.c</tt>)<br>
|
||||
Fixed writing data is truncated at the file offset 4GiB on the exFAT volume. (appeared at R0.12)<br>
|
||||
Fixed creating a file in the root directory of exFAT volume can fail. (appeared at R0.12)<br>
|
||||
Fixed <tt>f_mkfs</tt> creating exFAT volume with too small cluster size can collapse unallocated memory. (appeared at R0.12a)<br>
|
||||
Fixed wrong object name can be returned when read directory at Unicode cfg. (appeared at R0.12)<br>
|
||||
Fixed large file allocation/removing on the exFAT volume collapses allocation bitmap. (appeared at R0.12)<br>
|
||||
Fixed some internal errors in <tt>f_expand</tt> and <tt>f_lseek.</tt> (appeared at R0.12)<br>
|
||||
<ul class="plain">
|
||||
<li>Made <tt>f_rename</tt> be able to rename objects with the same name but case.</li>
|
||||
<li>Fixed an error in the case conversion teble of code page 866. (<tt>ff.c</tt>)</li>
|
||||
<li>Fixed writing data is truncated at the file offset 4GiB on the exFAT volume. (appeared at R0.12)</<li>
|
||||
<li>Fixed creating a file in the root directory of exFAT volume can fail. (appeared at R0.12)</li>
|
||||
<li>Fixed <tt>f_mkfs</tt> creating exFAT volume with too small cluster size can collapse unallocated memory. (appeared at R0.12a)</li>
|
||||
<li>Fixed wrong object name can be returned when read directory at Unicode cfg. (appeared at R0.12)</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.12a<br>Jul 10, 2016</td>
|
||||
<td>
|
||||
Added support for creating exFAT volume with some changes of <tt>f_mkfs</tt>.<br>
|
||||
Added a file open method <tt>FA_OPEN_APPEND</tt>.<br>
|
||||
<tt>f_forward</tt> is available regardless of <tt>_FS_TINY</tt>.<br>
|
||||
Fixed <tt>f_mkfs</tt> creates broken volume. (appeared at R0.12)<br>
|
||||
Fixed wrong memory read in <tt>create_name</tt>. (appeared at R0.12)<br>
|
||||
Fixed compilation fails at some configurations, <tt>_USE_FASTSEEK</tt> and <tt>_USE_FORWARD</tt>.<br>
|
||||
<ul class="plain">
|
||||
<li>Added support for creating exFAT volume with some changes of <tt>f_mkfs</tt>.</li>
|
||||
<li>Added a file open method <tt>FA_OPEN_APPEND</tt>.</li>
|
||||
<li><tt>f_forward</tt> is available regardless of <tt>_FS_TINY</tt>.</li>
|
||||
<li>Fixed <tt>f_mkfs</tt> creates broken volume. (appeared at R0.12)</li>
|
||||
<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>
|
||||
Usage of <tt>f_mkfs</tt> is changed.<br>
|
||||
<ul class="plain">
|
||||
<li>Usage of <tt>f_mkfs</tt> is changed.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.12<br>Apr 12, 2016</td>
|
||||
<td>
|
||||
Added support for exFAT file system. (<tt>_FS_EXFAT</tt>)<br>
|
||||
Added <tt>f_expand</tt>. (<tt>_USE_EXPAND</tt>)<br>
|
||||
Changed some members in <tt>FINFO</tt> and behavior of <tt>f_readdir</tt>.<br>
|
||||
Added a configuration option <tt>_USE_CHMOD</tt>.<br>
|
||||
Fixed errors in the case conversion teble of Unicode (<tt>cc*.c</tt>).<br>
|
||||
<ul class="plain">
|
||||
<li>Added support for exFAT file system. (<tt>_FS_EXFAT</tt>)</li>
|
||||
<li>Added <tt>f_expand</tt>. (<tt>_USE_EXPAND</tt>)</li>
|
||||
<li>Changed some members in <tt>FINFO</tt> and behavior of <tt>f_readdir</tt>.</li>
|
||||
<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>
|
||||
Usage and members of <tt>FINFO</tt> sructure used in <tt>f_readdir</tt> is changed.<br>
|
||||
Many members in <tt>FIL</tt> and <tt>DIR</tt> structure are changed.<br>
|
||||
To use <tt>f_chmod</tt>, <tt>_USE_CHMOD</tt> needs to be set.<br>
|
||||
<tt>_WORD_ACCESS</tt> is removed from the configuration options.<br>
|
||||
Dot entries are never appear in <tt>f_reeddir</tt>.<br>
|
||||
<ul class="plain">
|
||||
<li>Usage and members of <tt>FINFO</tt> sructure used in <tt>f_readdir</tt> is changed.</li>
|
||||
<li>Dot entries in the sub-directory are never appear in <tt>f_readdir</tt>.</li>
|
||||
<li><tt>".."</tt> does not work as path name in exFAT volume.</li>
|
||||
<li><tt>f_getcwd</tt> does not work in exFAT volume.</li>
|
||||
<li>Many members in <tt>FIL</tt> and <tt>DIR</tt> structure are changed.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.11a<br>Sep 5, 2015</td>
|
||||
<td>
|
||||
Fixed wrong media change can lead a deadlock at thread-safe configuration.<br>
|
||||
Added code page 771, 860, 861, 863, 864, 865 and 869. (<tt>_CODE_PAGE</tt>)<br>
|
||||
Fixed errors in the case conversion teble of code page 437 and 850 (<tt>ff.c</tt>).<br>
|
||||
Fixed errors in the case conversion teble of Unicode (<tt>cc*.c</tt>).<br>
|
||||
<ul class="plain">
|
||||
<li>Fixed wrong media change can lead a deadlock at thread-safe configuration.</li>
|
||||
<li>Added code page 771, 860, 861, 863, 864, 865 and 869. (<tt>_CODE_PAGE</tt>)</li>
|
||||
<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>
|
||||
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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.11<br>Feb 9, 2015</td>
|
||||
<td>
|
||||
Added <tt>f_findfirst</tt> and <tt>f_findnext.</tt> (<tt>_USE_FIND</tt>)<br>
|
||||
Fixed <tt>f_unlink</tt> does not remove cluster chain of the file. (appeared at R0.10c)<br>
|
||||
Fixed <tt>_FS_NORTC</tt> option does not work properly. (appeared at R0.10c)<br>
|
||||
<ul class="plain">
|
||||
<li>Added <tt>f_findfirst</tt> and <tt>f_findnext.</tt> (<tt>_USE_FIND</tt>)</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.10c<br>Nov 9, 2014</td>
|
||||
<td>
|
||||
Added a configuration option for the platforms without RTC. (<tt>_FS_NORTC</tt>)<br>
|
||||
Fixed volume label created by Mac OS X cannot be retrieved with <tt>f_getlabel</tt>. (appeared at R0.09b)<br>
|
||||
Fixed a potential problem of FAT access that can appear on disk error.<br>
|
||||
Fixed null pointer dereference on attempting to delete the root direcotry. (appeared at R0.08)<br>
|
||||
<ul class="plain">
|
||||
<li>Added a configuration option for the platforms without RTC. (<tt>_FS_NORTC</tt>)</li>
|
||||
<li>Fixed volume label created by Mac OS X cannot be retrieved with <tt>f_getlabel</tt>. (appeared at R0.09b)</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.10b<br>May 19, 2014</td>
|
||||
<td>
|
||||
Fixed a hard error in the disk I/O layer can collapse the directory entry.<br>
|
||||
Fixed LFN entry is not deleted on delete/rename an object with its lossy converted SFN. (appeared at R0.07)<br>
|
||||
<ul class="plain">
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.10a<br>Jan 15, 2014</td>
|
||||
<td>
|
||||
Added arbitrary strings as drive number in the path name. (<tt>_STR_VOLUME_ID</tt>)<br>
|
||||
Added an option for minimum sector size. (<tt>_MIN_SS</tt>)<br>
|
||||
2nd argument of <tt>f_rename</tt> can have a drive number and it will be ignored.<br>
|
||||
Fixed <tt>f_mount</tt> with forced mount fails when drive number is larger than 0. (appeared at R0.10)<br>
|
||||
Fixed <tt>f_close</tt> invalidates the file object without volume lock.<br>
|
||||
Fixed volume lock is left acquired after return from <tt>f_closedir</tt>. (appeared at R0.10)<br>
|
||||
Fixed creation of a directory entry with LFN fails on too many SFN collisions. (appeared at R0.07)<br>
|
||||
<ul class="plain">
|
||||
<li>Added arbitrary strings as drive number in the path name. (<tt>_STR_VOLUME_ID</tt>)</li>
|
||||
<li>Added an option for minimum sector size. (<tt>_MIN_SS</tt>)</li>
|
||||
<li>2nd argument of <tt>f_rename</tt> can have a drive number and it will be ignored.</li>
|
||||
<li>Fixed <tt>f_mount</tt> with forced mount fails when drive number is larger than 0. (appeared at R0.10)</li>
|
||||
<li>Fixed <tt>f_close</tt> invalidates the file object without volume lock.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.10<br>Oct 2, 2013</td>
|
||||
<td>
|
||||
Added an option for character encoding on the file. (<tt>_STRF_ENCODE</tt>)<br>
|
||||
Added f_closedir.<br>
|
||||
Added forced full FAT scan option for <tt>f_getfree</tt>. (<tt>_FS_NOFSINFO</tt>)<br>
|
||||
Added forced mount option with changes of <tt>f_mount</tt>.<br>
|
||||
Improved behavior of volume auto detection.<br>
|
||||
Improved write throughput of <tt>f_puts</tt> and <tt>f_printf</tt>.<br>
|
||||
Changed argument of <tt>f_chdrive,</tt> <tt>f_mkfs</tt>, <tt>disk_read</tt> and <tt>disk_write</tt>.<br>
|
||||
Fixed <tt>f_write</tt> can be truncated when the file size is close to 4 GB.<br>
|
||||
Fixed <tt>f_open</tt>, <tt>f_mkdir</tt> and <tt>f_setlabel</tt> can return incorrect result code on error.<br>
|
||||
<ul class="plain">
|
||||
<li>Added an option for character encoding on the file. (<tt>_STRF_ENCODE</tt>)</li>
|
||||
<li>Added f_closedir.</li>
|
||||
<li>Added forced full FAT scan option for <tt>f_getfree</tt>. (<tt>_FS_NOFSINFO</tt>)</li>
|
||||
<li>Added forced mount option with changes of <tt>f_mount</tt>.</li>
|
||||
<li>Improved behavior of volume auto detection.</li>
|
||||
<li>Improved write throughput of <tt>f_puts</tt> and <tt>f_printf</tt>.</li>
|
||||
<li>Changed argument of <tt>f_chdrive,</tt> <tt>f_mkfs</tt>, <tt>disk_read</tt> and <tt>disk_write</tt>.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.09b<br>Jan 24, 2013</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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.09a<br>Aug 27, 2012</td>
|
||||
<td>
|
||||
Fixed assertion failure due to OS/2 EA on FAT12/16 volume.<br>
|
||||
Changed file functions reject null object pointer to avoid crash.<br>
|
||||
Changed option name <tt>_FS_SHARE</tt> to <tt>_FS_LOCK</tt>.<br>
|
||||
<ul class="plain">
|
||||
<li>Fixed assertion failure due to OS/2 EA on FAT12/16 volume.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.09<br>Sep 6, 2011</td>
|
||||
<td>
|
||||
<tt>f_mkfs</tt> supports multiple partition on a physical drive.<br>
|
||||
Added <tt>f_fdisk</tt>. (<tt>_MULTI_PARTITION = 2</tt>)<br>
|
||||
<ul class="plain">
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.08b<br>Jan 15, 2011</td>
|
||||
<td>
|
||||
Fast seek function is also applied to <tt>f_read</tt> and <tt>f_write</tt>.<br>
|
||||
<tt>f_lseek</tt> reports required table size on creating CLMP.<br>
|
||||
Extended format syntax of <tt>f_printf</tt>.<br>
|
||||
Ignores duplicated directory separators in given path names.<br>
|
||||
<ul class="plain">
|
||||
<li>Fast seek function is also applied to <tt>f_read</tt> and <tt>f_write</tt>.</li>
|
||||
<li><tt>f_lseek</tt> reports required table size on creating CLMP.</li>
|
||||
<li>Extended format syntax of <tt>f_printf</tt>.</li>
|
||||
<li>Ignores duplicated directory separators in given path names.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.08a<br>Aug 16, 2010</td>
|
||||
<td>
|
||||
Added <tt>f_getcwd</tt>. (<tt>_FS_RPATH = 2</tt>)<br>
|
||||
Added sector erase function. (<tt>_USE_ERASE</tt>)<br>
|
||||
Moved file lock semaphore table from fs object to the bss.<br>
|
||||
Fixed <tt>f_mkdir</tt> creates wrong directory on non-LFN cfg when the given name contains <tt>';'</tt>.<br>
|
||||
Fixed <tt>f_mkfs</tt> creates wrong FAT32 volume.<br>
|
||||
<ul class="plain">
|
||||
<li>Added <tt>f_getcwd</tt>. (<tt>_FS_RPATH = 2</tt>)</li>
|
||||
<li>Added sector erase function. (<tt>_USE_ERASE</tt>)</li>
|
||||
<li>Moved file lock semaphore table from fs object to the bss.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.08<br>May 15, 2010</td>
|
||||
<td>
|
||||
Added an option to <tt>_USE_LFN</tt><br>
|
||||
Added support of file lock. (<tt>_FS_SHARE</tt>)<br>
|
||||
Added fast seek function. (<tt>_USE_FASTSEEK</tt>)<br>
|
||||
Changed a type name on the API, <tt>XCHAR</tt> to <tt>TCHAR</tt>.<br>
|
||||
Changed member, <tt>fname</tt>, in the <tt>FILINFO</tt> on Unicode cfg.<br>
|
||||
String functions support UTF-8 encoding files on Unicode cfg.<br>
|
||||
<ul class="plain">
|
||||
<li>Added an option to <tt>_USE_LFN</tt></li>
|
||||
<li>Added support of file lock. (<tt>_FS_SHARE</tt>)</li>
|
||||
<li>Added fast seek function. (<tt>_USE_FASTSEEK</tt>)</li>
|
||||
<li>Changed a type name on the API, <tt>XCHAR</tt> to <tt>TCHAR</tt>.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.07e<br>Nov 3, 2009</td>
|
||||
<td>
|
||||
Separated out configuration options from <tt>ff.h</tt> to <tt>ffconf.h</tt>.<br>
|
||||
Added a configuration option, <tt>_LFN_UNICODE</tt>.<br>
|
||||
Fixed <tt>f_unlink</tt> fails to remove a sub-dir on <tt>_FS_RPATH</tt>.<br>
|
||||
Fixed name matching error on the 13 char boundary.<br>
|
||||
Changed <tt>f_readdir</tt> to return the SFN with always upper case on non-LFN cfg.<br>
|
||||
<ul class="plain">
|
||||
<li>Separated out configuration options from <tt>ff.h</tt> to <tt>ffconf.h</tt>.</li>
|
||||
<li>Added a configuration option, <tt>_LFN_UNICODE</tt>.</li>
|
||||
<li>Fixed <tt>f_unlink</tt> fails to remove a sub-dir on <tt>_FS_RPATH</tt>.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.07c<br>Jan 21, 2009</td>
|
||||
<td>
|
||||
Fixed <tt>f_unlink</tt> may return FR_OK on error.<br>
|
||||
Fixed wrong cache control in <tt>f_lseek</tt>.<br>
|
||||
Added support of relative path.<br>
|
||||
Added <tt>f_chdir</tt>.<br>
|
||||
Added <tt>f_chdrive</tt>.<br>
|
||||
Added proper case conversion to extended characters.<br>
|
||||
<ul class="plain">
|
||||
<li>Fixed <tt>f_unlink</tt> may return FR_OK on error.</li>
|
||||
<li>Fixed wrong cache control in <tt>f_lseek</tt>.</li>
|
||||
<li>Added support of relative path.</li>
|
||||
<li>Added <tt>f_chdir</tt>.</li>
|
||||
<li>Added <tt>f_chdrive</tt>.</li>
|
||||
<li>Added proper case conversion to extended characters.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.07a<br>Apr 14, 2009</td>
|
||||
<td>
|
||||
Separated out OS dependent code on re-entrant configuration.<br>
|
||||
Added multiple sector size support.<br>
|
||||
<ul class="plain">
|
||||
<li>Separated out OS dependent code on re-entrant configuration.</li>
|
||||
<li>Added multiple sector size support.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.07<br>Apr 1, 2009</td>
|
||||
<td>
|
||||
Merged Tiny-FatFs into FatFs as a buffer configuration option.<br>
|
||||
Added support for long file extension.<br>
|
||||
Added multiple code page support.<br>
|
||||
Added re-entrancy for multitask operation.<br>
|
||||
Added auto cluster size selection to <tt>f_mkfs</tt>.<br>
|
||||
Added rewind option to <tt>f_readdir</tt>.<br>
|
||||
Changed result code of critical errors.<br>
|
||||
Renamed string functions to avoid name collision.<br>
|
||||
<ul class="plain">
|
||||
<li>Merged Tiny-FatFs into FatFs as a buffer configuration option.</li>
|
||||
<li>Added support for long file extension.</li>
|
||||
<li>Added multiple code page support.</li>
|
||||
<li>Added re-entrancy for multitask operation.</li>
|
||||
<li>Added auto cluster size selection to <tt>f_mkfs</tt>.</li>
|
||||
<li>Added rewind option to <tt>f_readdir</tt>.</li>
|
||||
<li>Changed result code of critical errors.</li>
|
||||
<li>Renamed string functions to avoid name collision.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.06<br>Apr 1, 2008</td>
|
||||
<td>
|
||||
Added <tt>f_forward</tt>. (Tiny-FatFs)<br>
|
||||
Added string functions: <tt>f_gets</tt>, <tt>f_putc</tt>, <tt>f_puts</tt> and <tt>f_printf</tt>.<br>
|
||||
Improved performance of <tt>f_lseek</tt> on moving to the same or following cluster.<br>
|
||||
<ul class="plain">
|
||||
<li>Added <tt>f_forward</tt>. (Tiny-FatFs)</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.05a<br>Feb 3, 2008</td>
|
||||
<td>
|
||||
Added <tt>f_truncate</tt>.<br>
|
||||
Added <tt>f_utime</tt>.<br>
|
||||
Fixed off by one error at FAT sub-type determination.<br>
|
||||
Fixed btr in <tt>f_read</tt> can be mistruncated.<br>
|
||||
Fixed cached sector is left not flushed when create and close without write.<br>
|
||||
<ul class="plain">
|
||||
<li>Added <tt>f_truncate</tt>.</li>
|
||||
<li>Added <tt>f_utime</tt>.</li>
|
||||
<li>Fixed off by one error at FAT sub-type determination.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.05<br>Aug 26, 2007</td>
|
||||
<td>
|
||||
Changed arguments of <tt>f_read</tt>, <tt>f_write</tt>.<br>
|
||||
Changed arguments of <tt>f_mkfs</tt>. (FatFs)<br>
|
||||
Fixed <tt>f_mkfs</tt> on FAT32 creates incorrect FSInfo. (FatFs)<br>
|
||||
Fixed <tt>f_mkdir</tt> on FAT32 creates broken directory. (FatFs)<br>
|
||||
<ul class="plain">
|
||||
<li>Changed arguments of <tt>f_read</tt>, <tt>f_write</tt>.</li>
|
||||
<li>Changed arguments of <tt>f_mkfs</tt>. (FatFs)</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.04b<br>May 5, 2007</td>
|
||||
<td>
|
||||
Added <tt>_USE_NTFLAG</tt> option.<br>
|
||||
Added support for FSInfo in FAT32 volume.<br>
|
||||
Fixed some problems corresponds to FAT32. (Tiny-FatFs)<br>
|
||||
Fixed DBCS name can result <tt>FR_INVALID_NAME</tt>.<br>
|
||||
Fixed short seek (<tt><= csize</tt>) collapses the file object.<br>
|
||||
<ul class="plain">
|
||||
<li>Added <tt>_USE_NTFLAG</tt> option.</li>
|
||||
<li>Added support for FSInfo in FAT32 volume.</li>
|
||||
<li>Fixed some problems corresponds to FAT32. (Tiny-FatFs)</li>
|
||||
<li>Fixed DBCS name can result <tt>FR_INVALID_NAME</tt>.</li>
|
||||
<li>Fixed short seek (<tt><= csize</tt>) collapses the file object.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.04a<br>Apr 1, 2007</td>
|
||||
<td>
|
||||
Supported multiple partitions on a plysical drive. (FatFs)<br>
|
||||
Added minimization level 3.<br>
|
||||
Added a capability of extending file size to <tt>f_lseek</tt>.<br>
|
||||
Fixed an endian sensitive code in <tt>f_mkfs</tt>. (FatFs)<br>
|
||||
Fixed a problem corresponds to FAT32 support. (Tiny-FatFs)<br>
|
||||
<ul class="plain">
|
||||
<li>Supported multiple partitions on a plysical drive. (FatFs)</li>
|
||||
<li>Added minimization level 3.</li>
|
||||
<li>Added a capability of extending file size to <tt>f_lseek</tt>.</li>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.04<br>Feb 4, 2007</td>
|
||||
<td>
|
||||
Supported multiple drive system. (FatFs)<br>
|
||||
Changed some APIs for multiple drive system.<br>
|
||||
Added <tt>f_mkfs</tt>. (FatFs)<br>
|
||||
Added <tt>_USE_FAT32</tt> option. (Tiny-FatFs)<br>
|
||||
<ul class="plain">
|
||||
<li>Supported multiple drive system. (FatFs)</li>
|
||||
<li>Changed some APIs for multiple drive system.</li>
|
||||
<li>Added <tt>f_mkfs</tt>. (FatFs)</li>
|
||||
<li>Added <tt>_USE_FAT32</tt> option. (Tiny-FatFs)</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.03a<br>Dec 11, 2006</td>
|
||||
<td>
|
||||
Improved cluster scan algolithm to write files fast.<br>
|
||||
Fixed <tt>f_mkdir</tt> creates broken directory on FAT32.<br>
|
||||
<ul class="plain">
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.03<br>Sep 22, 2006</td>
|
||||
<td>
|
||||
Added <tt>f_rename</tt>.
|
||||
Changed option <tt>_FS_MINIMUM</tt> to <tt>_FS_MINIMIZE</tt>.<br>
|
||||
<ul class="plain">
|
||||
<li>Added <tt>f_rename</tt>.
|
||||
<li>Changed option <tt>_FS_MINIMUM</tt> to <tt>_FS_MINIMIZE</tt>.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.02a<br>Jun 10, 2006</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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.02<br>Jun 01, 2006</td>
|
||||
<td>
|
||||
Added FAT12.<br>
|
||||
Removed unbuffered mode.<br>
|
||||
Fixed a problem on small (<tt><32M</tt>) patition.<br>
|
||||
<ul class="plain">
|
||||
<li>Added FAT12.</li>
|
||||
<li>Removed unbuffered mode.</li>
|
||||
<li>Fixed a problem on small (<tt><32M</tt>) patition.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>R0.01<br>Apr 29, 2006</td>
|
||||
<td>
|
||||
First release.<br>
|
||||
<ul class="plain">
|
||||
<li>First release.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="foot"><a href="index.html">Return</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -367,3 +367,23 @@ R0.15 (November 6, 2022)
|
||||
Fixed string functions cannot write the unicode characters not in BMP when FF_LFN_UNICODE == 2 (UTF-8).
|
||||
Fixed a compatibility issue in identification of GPT header.
|
||||
|
||||
|
||||
|
||||
R0.15a (November 22, 2024)
|
||||
Fixed a complie error when FF_FS_LOCK != 0.
|
||||
Fixed a potential issue when work FatFs concurrency with FF_FS_REENTRANT, FF_VOLUMES >= 2 and FF_FS_LOCK > 0.
|
||||
Made f_setlabel() accept a volume label in Unix style volume ID when FF_STR_VOLUME_ID == 2.
|
||||
Made FatFs update PercInUse field in exFAT VBR. (A preceding f_getfree() is needed for the accuracy)
|
||||
|
||||
|
||||
|
||||
R0.15b (June 21, 2025)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
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.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FatFs Module Source Files R0.15
|
||||
FatFs Module Source Files R0.16
|
||||
|
||||
|
||||
FILES
|
||||
|
||||
+11
-7
@@ -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 */
|
||||
/* 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. */
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
#include "ff.h" /* Obtains integer types */
|
||||
#include "diskio.h" /* Declarations of disk functions */
|
||||
#include "ff.h" /* Basic definitions of FatFs */
|
||||
#include "diskio.h" /* Declarations FatFs MAI */
|
||||
|
||||
/* Definitions of physical drive number for each drive */
|
||||
#define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */
|
||||
#define DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */
|
||||
#define DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */
|
||||
/* Example: Declarations of the platform and disk functions in the project */
|
||||
#include "platform.h"
|
||||
#include "storage.h"
|
||||
|
||||
/* 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 */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
+3
-3
@@ -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
|
||||
@@ -55,7 +55,7 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
||||
#define CTRL_EJECT 7 /* Eject 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_CSD 11 /* Get CSD */
|
||||
#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_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_MODEL 21 /* Get model name */
|
||||
#define ATA_GET_SN 22 /* Get serial number */
|
||||
|
||||
+1069
-910
File diff suppressed because it is too large
Load Diff
+115
-96
@@ -1,8 +1,8 @@
|
||||
/*----------------------------------------------------------------------------/
|
||||
/ FatFs - Generic FAT Filesystem module R0.15 /
|
||||
/ FatFs - Generic FAT Filesystem module R0.16 /
|
||||
/-----------------------------------------------------------------------------/
|
||||
/
|
||||
/ Copyright (C) 2022, ChaN, all right reserved.
|
||||
/ Copyright (C) 2025, ChaN, all right reserved.
|
||||
/
|
||||
/ FatFs module is an open source software. Redistribution and use of FatFs in
|
||||
/ source and binary forms, with or without modification, are permitted provided
|
||||
@@ -20,14 +20,15 @@
|
||||
|
||||
|
||||
#ifndef FF_DEFINED
|
||||
#define FF_DEFINED 80286 /* Revision ID */
|
||||
#define FF_DEFINED 80386 /* Revision ID */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(FFCONF_DEF)
|
||||
#include "ffconf.h" /* FatFs configuration options */
|
||||
|
||||
#endif
|
||||
#if FF_DEFINED != FFCONF_DEF
|
||||
#error Wrong configuration file (ffconf.h).
|
||||
#endif
|
||||
@@ -48,18 +49,18 @@ typedef unsigned __int64 QWORD;
|
||||
#include <stdint.h>
|
||||
typedef unsigned int UINT; /* int must be 16-bit or 32-bit */
|
||||
typedef unsigned char BYTE; /* char must be 8-bit */
|
||||
typedef uint16_t WORD; /* 16-bit unsigned integer */
|
||||
typedef uint32_t DWORD; /* 32-bit unsigned integer */
|
||||
typedef uint64_t QWORD; /* 64-bit unsigned integer */
|
||||
typedef WORD WCHAR; /* UTF-16 character type */
|
||||
typedef uint16_t WORD; /* 16-bit unsigned */
|
||||
typedef uint32_t DWORD; /* 32-bit unsigned */
|
||||
typedef uint64_t QWORD; /* 64-bit unsigned */
|
||||
typedef WORD WCHAR; /* UTF-16 code unit */
|
||||
|
||||
#else /* Earlier than C99 */
|
||||
#define FF_INTDEF 1
|
||||
typedef unsigned int UINT; /* int must be 16-bit or 32-bit */
|
||||
typedef unsigned char BYTE; /* char must be 8-bit */
|
||||
typedef unsigned short WORD; /* 16-bit unsigned integer */
|
||||
typedef unsigned long DWORD; /* 32-bit unsigned integer */
|
||||
typedef WORD WCHAR; /* UTF-16 character type */
|
||||
typedef unsigned short WORD; /* short must be 16-bit */
|
||||
typedef unsigned long DWORD; /* long must be 32-bit */
|
||||
typedef WORD WCHAR; /* UTF-16 code unit */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -113,64 +114,78 @@ typedef char TCHAR;
|
||||
|
||||
#if FF_MULTI_PARTITION /* Multiple partition configuration */
|
||||
typedef struct {
|
||||
BYTE pd; /* Physical drive number */
|
||||
BYTE pt; /* Partition: 0:Auto detect, 1-4:Forced partition) */
|
||||
BYTE pd; /* Associated physical drive */
|
||||
BYTE pt; /* Associated partition (0:Auto detect, 1-4:Forced partition) */
|
||||
} PARTITION;
|
||||
extern PARTITION VolToPart[]; /* Volume - Partition mapping table */
|
||||
extern PARTITION VolToPart[]; /* Volume to partition mapping table */
|
||||
#endif
|
||||
|
||||
#if FF_STR_VOLUME_ID
|
||||
#ifndef FF_VOLUME_STRS
|
||||
extern const char* VolumeStr[FF_VOLUMES]; /* User defied volume ID */
|
||||
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) */
|
||||
|
||||
typedef struct {
|
||||
BYTE fs_type; /* Filesystem type (0:not mounted) */
|
||||
BYTE pdrv; /* Volume hosting physical drive */
|
||||
BYTE ldrv; /* Logical drive number (used only when FF_FS_REENTRANT) */
|
||||
BYTE n_fats; /* Number of FATs (1 or 2) */
|
||||
BYTE wflag; /* win[] status (b0:dirty) */
|
||||
BYTE fsi_flag; /* FSINFO status (b7:disabled, b0:dirty) */
|
||||
WORD id; /* Volume mount ID */
|
||||
WORD n_rootdir; /* Number of root directory entries (FAT12/16) */
|
||||
WORD csize; /* Cluster size [sectors] */
|
||||
BYTE fs_type; /* Filesystem type (0:not mounted) */
|
||||
BYTE pdrv; /* Physical drive that holds this volume */
|
||||
BYTE ldrv; /* Logical drive number (used only when FF_FS_REENTRANT) */
|
||||
BYTE n_fats; /* Number of FATs (1 or 2) */
|
||||
BYTE wflag; /* win[] status (b0:dirty) */
|
||||
BYTE fsi_flag; /* Allocation information control (b7:disabled, b0:dirty) */
|
||||
WORD id; /* Volume mount ID */
|
||||
WORD n_rootdir; /* Number of root directory entries (FAT12/16) */
|
||||
WORD csize; /* Cluster size [sectors] */
|
||||
#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
|
||||
#if FF_USE_LFN
|
||||
WCHAR* lfnbuf; /* LFN working buffer */
|
||||
#endif
|
||||
#if FF_FS_EXFAT
|
||||
BYTE* dirbuf; /* Directory entry block scratchpad buffer for exFAT */
|
||||
WCHAR* lfnbuf; /* Pointer to LFN working buffer */
|
||||
#endif
|
||||
#if !FF_FS_READONLY
|
||||
DWORD last_clst; /* Last allocated cluster */
|
||||
DWORD free_clst; /* Number of free clusters */
|
||||
DWORD last_clst; /* Last allocated cluster (invalid if >=n_fatent) */
|
||||
DWORD free_clst; /* Number of free clusters (invalid if >=fs->n_fatent-2) */
|
||||
#endif
|
||||
#if FF_FS_RPATH
|
||||
DWORD cdir; /* Current directory start cluster (0:root) */
|
||||
DWORD cdir; /* Current directory start cluster (0:root) */
|
||||
#endif
|
||||
DWORD n_fatent; /* Number of FAT entries (number of clusters + 2) */
|
||||
DWORD fsize; /* Number of sectors per FAT */
|
||||
LBA_t winsect; /* Current sector appearing in the win[] */
|
||||
LBA_t volbase; /* Volume base sector */
|
||||
LBA_t fatbase; /* FAT base sector */
|
||||
LBA_t dirbase; /* Root directory base sector (FAT12/16) or cluster (FAT32/exFAT) */
|
||||
LBA_t database; /* Data base sector */
|
||||
#if FF_FS_EXFAT
|
||||
DWORD cdc_scl; /* Containing directory start cluster (invalid when cdir is 0) */
|
||||
DWORD cdc_size; /* b31-b8:Size of containing directory, b7-b0: Chain status */
|
||||
DWORD cdc_ofs; /* Offset in the containing directory (invalid when cdir is 0) */
|
||||
LBA_t bitbase; /* Allocation bitmap base sector */
|
||||
BYTE* dirbuf; /* Pointer to directory entry block buffer */
|
||||
#if FF_FS_RPATH
|
||||
FFXCWDS xcwds; /* Crrent working directory structure */
|
||||
FFXCWDS xcwds2; /* Working buffer to follow the path */
|
||||
#endif
|
||||
#endif
|
||||
DWORD n_fatent; /* Number of FAT entries (number of clusters + 2) */
|
||||
DWORD fsize; /* Number of sectors per FAT */
|
||||
LBA_t volbase; /* Volume base sector */
|
||||
LBA_t fatbase; /* FAT base sector */
|
||||
LBA_t dirbase; /* Root directory base sector (FAT12/16) or cluster (FAT32/exFAT) */
|
||||
LBA_t database; /* Data base sector */
|
||||
#if FF_FS_EXFAT
|
||||
LBA_t bitbase; /* Allocation bitmap base sector */
|
||||
#endif
|
||||
LBA_t winsect; /* Current sector appearing in the win[] */
|
||||
BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */
|
||||
BYTE win[FF_MAX_SS]; /* Disk access window for directory, FAT (and file data in tiny cfg) */
|
||||
} FATFS;
|
||||
|
||||
|
||||
@@ -178,21 +193,21 @@ typedef struct {
|
||||
/* Object ID and allocation information (FFOBJID) */
|
||||
|
||||
typedef struct {
|
||||
FATFS* fs; /* Pointer to the hosting volume of this object */
|
||||
WORD id; /* Hosting volume's mount ID */
|
||||
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) */
|
||||
DWORD sclust; /* Object data start cluster (0:no cluster or root directory) */
|
||||
FSIZE_t objsize; /* Object size (valid when sclust != 0) */
|
||||
FATFS* fs; /* Pointer to the volume holding this object */
|
||||
WORD id; /* Volume mount ID when this object was opened */
|
||||
BYTE attr; /* Object attribute */
|
||||
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 cluster (0:no data or root directory) */
|
||||
FSIZE_t objsize; /* Object size (valid when sclust != 0) */
|
||||
#if FF_FS_EXFAT
|
||||
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 c_scl; /* Containing directory start cluster (valid when sclust != 0) */
|
||||
DWORD c_size; /* b31-b8:Size of containing directory, b7-b0: Chain status (valid when c_scl != 0) */
|
||||
DWORD c_ofs; /* Offset in the containing directory (valid when file object and sclust != 0) */
|
||||
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 c_scl; /* Cluster of directory holding this object (valid when sclust != 0) */
|
||||
DWORD c_size; /* Size of directory holding this object (b7-b0: allocation status, valid when c_scl != 0) */
|
||||
DWORD c_ofs; /* Offset of entry in the holding directory */
|
||||
#endif
|
||||
#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
|
||||
} FFOBJID;
|
||||
|
||||
@@ -201,18 +216,18 @@ typedef struct {
|
||||
/* File object structure (FIL) */
|
||||
|
||||
typedef struct {
|
||||
FFOBJID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */
|
||||
BYTE flag; /* File status flags */
|
||||
BYTE err; /* Abort flag (error code) */
|
||||
FSIZE_t fptr; /* File read/write pointer (Zeroed on file open) */
|
||||
DWORD clust; /* Current cluster of fpter (invalid when fptr is 0) */
|
||||
LBA_t sect; /* Sector number appearing in buf[] (0:invalid) */
|
||||
FFOBJID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */
|
||||
BYTE flag; /* File status flags */
|
||||
BYTE err; /* Abort flag (error code) */
|
||||
FSIZE_t fptr; /* File read/write pointer (0 on open) */
|
||||
DWORD clust; /* Current cluster of fptr (invalid when fptr is 0) */
|
||||
LBA_t sect; /* Sector number appearing in buf[] (0:invalid) */
|
||||
#if !FF_FS_READONLY
|
||||
LBA_t dir_sect; /* Sector number containing the directory entry (not used at exFAT) */
|
||||
BYTE* dir_ptr; /* Pointer to the directory entry in the win[] (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 in exFAT) */
|
||||
#endif
|
||||
#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
|
||||
#if !FF_FS_TINY
|
||||
BYTE buf[FF_MAX_SS]; /* File private data read/write window */
|
||||
@@ -224,40 +239,44 @@ typedef struct {
|
||||
/* Directory object structure (DIR) */
|
||||
|
||||
typedef struct {
|
||||
FFOBJID obj; /* Object identifier */
|
||||
DWORD dptr; /* Current read/write offset */
|
||||
DWORD clust; /* Current cluster */
|
||||
LBA_t sect; /* Current sector (0:Read operation has terminated) */
|
||||
BYTE* dir; /* Pointer to the directory item in the win[] */
|
||||
BYTE fn[12]; /* SFN (in/out) {body[8],ext[3],status[1]} */
|
||||
FFOBJID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */
|
||||
DWORD dptr; /* Current read/write offset */
|
||||
DWORD clust; /* Current cluster */
|
||||
LBA_t sect; /* Current sector (0:no more item to read) */
|
||||
BYTE* dir; /* Pointer to the directory item in the win[] in filesystem object */
|
||||
BYTE fn[12]; /* SFN (in/out) {body[0-7],ext[8-10],status[11]} */
|
||||
#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
|
||||
#if FF_USE_FIND
|
||||
const TCHAR* pat; /* Pointer to the name matching pattern */
|
||||
const TCHAR *pat; /* Pointer to the name matching pattern */
|
||||
#endif
|
||||
} DIR;
|
||||
|
||||
|
||||
|
||||
/* File information structure (FILINFO) */
|
||||
/* File/directory information structure (FILINFO) */
|
||||
|
||||
typedef struct {
|
||||
FSIZE_t fsize; /* File size */
|
||||
WORD fdate; /* Modified date */
|
||||
WORD ftime; /* Modified time */
|
||||
BYTE fattrib; /* File attribute */
|
||||
FSIZE_t fsize; /* File size (invalid for directory) */
|
||||
WORD fdate; /* Date of file modification or directory creation */
|
||||
WORD ftime; /* Time of file modification or directory creation */
|
||||
#if FF_FS_CRTIME
|
||||
WORD crdate; /* Date of object createion */
|
||||
WORD crtime; /* Time of object createion */
|
||||
#endif
|
||||
BYTE fattrib; /* Object attribute */
|
||||
#if FF_USE_LFN
|
||||
TCHAR altname[FF_SFN_BUF + 1];/* Alternative file name */
|
||||
TCHAR fname[FF_LFN_BUF + 1]; /* Primary file name */
|
||||
TCHAR altname[FF_SFN_BUF + 1];/* Alternative object name */
|
||||
TCHAR fname[FF_LFN_BUF + 1]; /* Primary object name */
|
||||
#else
|
||||
TCHAR fname[12 + 1]; /* File name */
|
||||
TCHAR fname[12 + 1]; /* Object name */
|
||||
#endif
|
||||
} FILINFO;
|
||||
|
||||
|
||||
|
||||
/* Format parameter structure (MKFS_PARM) */
|
||||
/* Format parameter structure (MKFS_PARM) used for f_mkfs() */
|
||||
|
||||
typedef struct {
|
||||
BYTE fmt; /* Format option (FM_FAT, FM_FAT32, FM_EXFAT and FM_SFD) */
|
||||
@@ -272,24 +291,24 @@ typedef struct {
|
||||
/* File function return code (FRESULT) */
|
||||
|
||||
typedef enum {
|
||||
FR_OK = 0, /* (0) Succeeded */
|
||||
FR_OK = 0, /* (0) Function succeeded */
|
||||
FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */
|
||||
FR_INT_ERR, /* (2) Assertion failed */
|
||||
FR_NOT_READY, /* (3) The physical drive cannot work */
|
||||
FR_NOT_READY, /* (3) The physical drive does not work */
|
||||
FR_NO_FILE, /* (4) Could not find the file */
|
||||
FR_NO_PATH, /* (5) Could not find the path */
|
||||
FR_INVALID_NAME, /* (6) The path name format is invalid */
|
||||
FR_DENIED, /* (7) Access denied due to prohibited access or directory full */
|
||||
FR_EXIST, /* (8) Access denied due to prohibited access */
|
||||
FR_DENIED, /* (7) Access denied due to a prohibited access or directory full */
|
||||
FR_EXIST, /* (8) Access denied due to a prohibited access */
|
||||
FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */
|
||||
FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */
|
||||
FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */
|
||||
FR_NOT_ENABLED, /* (12) The volume has no work area */
|
||||
FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */
|
||||
FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any problem */
|
||||
FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */
|
||||
FR_NO_FILESYSTEM, /* (13) Could not find a valid FAT volume */
|
||||
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_LOCKED, /* (16) The operation is rejected according to the file sharing policy */
|
||||
FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */
|
||||
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_INVALID_PARAMETER /* (19) Given parameter is invalid */
|
||||
} FRESULT;
|
||||
@@ -375,7 +394,7 @@ DWORD ff_wtoupper (DWORD uni); /* Unicode upper-case conversion */
|
||||
void* ff_memalloc (UINT msize); /* Allocate memory block */
|
||||
void ff_memfree (void* mblock); /* Free memory block */
|
||||
#endif
|
||||
#if FF_FS_REENTRANT /* Sync functions */
|
||||
#if FF_FS_REENTRANT /* Sync functions */
|
||||
int ff_mutex_create (int vol); /* Create a sync object */
|
||||
void ff_mutex_delete (int vol); /* Delete a sync object */
|
||||
int ff_mutex_take (int vol); /* Lock sync object */
|
||||
@@ -389,7 +408,7 @@ void ff_mutex_give (int vol); /* Unlock sync object */
|
||||
/* Flags and Offset Address */
|
||||
/*--------------------------------------------------------------*/
|
||||
|
||||
/* File access mode and open method flags (3rd argument of f_open) */
|
||||
/* File access mode and open method flags (3rd argument of f_open function) */
|
||||
#define FA_READ 0x01
|
||||
#define FA_WRITE 0x02
|
||||
#define FA_OPEN_EXISTING 0x00
|
||||
@@ -398,10 +417,10 @@ void ff_mutex_give (int vol); /* Unlock sync object */
|
||||
#define FA_OPEN_ALWAYS 0x10
|
||||
#define FA_OPEN_APPEND 0x30
|
||||
|
||||
/* Fast seek controls (2nd argument of f_lseek) */
|
||||
/* Fast seek controls (2nd argument of f_lseek function) */
|
||||
#define CREATE_LINKMAP ((FSIZE_t)0 - 1)
|
||||
|
||||
/* Format options (2nd argument of f_mkfs) */
|
||||
/* Format options (2nd argument of f_mkfs function) */
|
||||
#define FM_FAT 0x01
|
||||
#define FM_FAT32 0x02
|
||||
#define FM_EXFAT 0x04
|
||||
|
||||
+55
-38
@@ -2,7 +2,7 @@
|
||||
/ Configurations of FatFs Module
|
||||
/---------------------------------------------------------------------------*/
|
||||
|
||||
#define FFCONF_DEF 80286 /* Revision ID */
|
||||
#define FFCONF_DEF 80386 /* Revision ID */
|
||||
|
||||
/*---------------------------------------------------------------------------/
|
||||
/ Function Configurations
|
||||
@@ -31,36 +31,36 @@
|
||||
|
||||
|
||||
#define FF_USE_MKFS 0
|
||||
/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
|
||||
/* This option switches f_mkfs(). (0:Disable or 1:Enable) */
|
||||
|
||||
|
||||
#define FF_USE_FASTSEEK 0
|
||||
/* This option switches fast seek function. (0:Disable or 1:Enable) */
|
||||
/* This option switches fast seek feature. (0:Disable or 1:Enable) */
|
||||
|
||||
|
||||
#define FF_USE_EXPAND 0
|
||||
/* This option switches f_expand function. (0:Disable or 1:Enable) */
|
||||
/* This option switches f_expand(). (0:Disable or 1:Enable) */
|
||||
|
||||
|
||||
#define FF_USE_CHMOD 0
|
||||
/* This option switches attribute manipulation functions, f_chmod() and f_utime().
|
||||
/* This option switches attribute control API functions, f_chmod() and f_utime().
|
||||
/ (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */
|
||||
|
||||
|
||||
#define FF_USE_LABEL 0
|
||||
/* This option switches volume label functions, f_getlabel() and f_setlabel().
|
||||
/* This option switches volume label API functions, f_getlabel() and f_setlabel().
|
||||
/ (0:Disable or 1:Enable) */
|
||||
|
||||
|
||||
#define FF_USE_FORWARD 0
|
||||
/* This option switches f_forward() function. (0:Disable or 1:Enable) */
|
||||
/* This option switches f_forward(). (0:Disable or 1:Enable) */
|
||||
|
||||
|
||||
#define FF_USE_STRFUNC 0
|
||||
#define FF_PRINT_LLI 1
|
||||
#define FF_PRINT_FLOAT 1
|
||||
#define FF_STRF_ENCODE 3
|
||||
/* FF_USE_STRFUNC switches string functions, f_gets(), f_putc(), f_puts() and
|
||||
#define FF_PRINT_LLI 0
|
||||
#define FF_PRINT_FLOAT 0
|
||||
#define FF_STRF_ENCODE 0
|
||||
/* FF_USE_STRFUNC switches string API functions, f_gets(), f_putc(), f_puts() and
|
||||
/ f_printf().
|
||||
/
|
||||
/ 0: Disable. FF_PRINT_LLI, FF_PRINT_FLOAT and FF_STRF_ENCODE have no effect.
|
||||
@@ -69,7 +69,7 @@
|
||||
/
|
||||
/ FF_PRINT_LLI = 1 makes f_printf() support long long argument and FF_PRINT_FLOAT = 1/2
|
||||
/ makes f_printf() support floating point argument. These features want C99 or later.
|
||||
/ When FF_LFN_UNICODE >= 1 with LFN enabled, string functions convert the character
|
||||
/ When FF_LFN_UNICODE >= 1 with LFN enabled, string API functions convert the character
|
||||
/ encoding in it. FF_STRF_ENCODE selects assumption of character encoding ON THE FILE
|
||||
/ to be read/written via those functions.
|
||||
/
|
||||
@@ -118,15 +118,15 @@
|
||||
/* The FF_USE_LFN switches the support for LFN (long file name).
|
||||
/
|
||||
/ 0: Disable LFN. FF_MAX_LFN has no effect.
|
||||
/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
|
||||
/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
|
||||
/ 2: Enable LFN with dynamic working buffer on the STACK.
|
||||
/ 3: Enable LFN with dynamic working buffer on the HEAP.
|
||||
/
|
||||
/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function
|
||||
/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN feature
|
||||
/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and
|
||||
/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled.
|
||||
/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can
|
||||
/ be in range of 12 to 255. It is recommended to be set it 255 to fully support LFN
|
||||
/ be in range of 12 to 255. It is recommended to be set 255 to fully support the LFN
|
||||
/ specification.
|
||||
/ When use stack for the working buffer, take care on stack overflow. When use heap
|
||||
/ memory for the working buffer, memory management functions, ff_memalloc() and
|
||||
@@ -154,14 +154,26 @@
|
||||
|
||||
|
||||
#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 functions.
|
||||
/ 1: Enable relative path. f_chdir() and f_chdrive() are available.
|
||||
/ 2: f_getcwd() function is available in addition to 1.
|
||||
/ 0: Disable relative path and remove related API functions.
|
||||
/ 1: Enable relative path and dot names. f_chdir() and f_chdrive() are available.
|
||||
/ 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
|
||||
/---------------------------------------------------------------------------*/
|
||||
@@ -175,7 +187,7 @@
|
||||
/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings.
|
||||
/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive
|
||||
/ number in the path name. FF_VOLUME_STRS defines the volume ID strings for each
|
||||
/ logical drives. Number of items must not be less than FF_VOLUMES. Valid
|
||||
/ logical drive. Number of items must not be less than FF_VOLUMES. Valid
|
||||
/ characters for the volume ID strings are A-Z, a-z and 0-9, however, they are
|
||||
/ compared in case-insensitive. If FF_STR_VOLUME_ID >= 1 and FF_VOLUME_STRS is
|
||||
/ not defined, a user defined volume string table is needed as:
|
||||
@@ -188,9 +200,9 @@
|
||||
/* This option switches support for multiple volumes on the physical drive.
|
||||
/ By default (0), each logical drive number is bound to the same physical drive
|
||||
/ number and only an FAT volume found on the physical drive will be mounted.
|
||||
/ When this function is enabled (1), each logical drive number can be bound to
|
||||
/ When this feature is enabled (1), each logical drive number can be bound to
|
||||
/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk()
|
||||
/ function will be available. */
|
||||
/ will be available. */
|
||||
|
||||
|
||||
#define FF_MIN_SS 512
|
||||
@@ -198,8 +210,8 @@
|
||||
/* This set of options configures the range of sector size to be supported. (512,
|
||||
/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and
|
||||
/ harddisk, but a larger value may be required for on-board flash memory and some
|
||||
/ type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured
|
||||
/ for variable sector size mode and disk_ioctl() function needs to implement
|
||||
/ type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is
|
||||
/ configured for variable sector size mode and disk_ioctl() needs to implement
|
||||
/ GET_SECTOR_SIZE command. */
|
||||
|
||||
|
||||
@@ -209,14 +221,14 @@
|
||||
|
||||
|
||||
#define FF_MIN_GPT 0x10000000
|
||||
/* Minimum number of sectors to switch GPT as partitioning format in f_mkfs and
|
||||
/ f_fdisk function. 0x100000000 max. This option has no effect when FF_LBA64 == 0. */
|
||||
/* Minimum number of sectors to switch GPT as partitioning format in f_mkfs() and
|
||||
/ f_fdisk(). 2^32 sectors maximum. This option has no effect when FF_LBA64 == 0. */
|
||||
|
||||
|
||||
#define FF_USE_TRIM 0
|
||||
/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable)
|
||||
/ To enable Trim function, also CTRL_TRIM command should be implemented to the
|
||||
/ disk_ioctl() function. */
|
||||
/ To enable this feature, also CTRL_TRIM command should be implemented to
|
||||
/ the disk_ioctl(). */
|
||||
|
||||
|
||||
|
||||
@@ -226,7 +238,7 @@
|
||||
|
||||
#define FF_FS_TINY 0
|
||||
/* 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
|
||||
/ buffer in the filesystem object (FATFS) is used for the file data transfer. */
|
||||
|
||||
@@ -240,20 +252,25 @@
|
||||
#define FF_FS_NORTC 0
|
||||
#define FF_NORTC_MON 1
|
||||
#define FF_NORTC_MDAY 1
|
||||
#define FF_NORTC_YEAR 2022
|
||||
#define FF_NORTC_YEAR 2025
|
||||
/* The option FF_FS_NORTC switches timestamp feature. If the system does not have
|
||||
/ an RTC or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable the
|
||||
/ timestamp feature. Every object modified by FatFs will have a fixed timestamp
|
||||
/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time.
|
||||
/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be
|
||||
/ added to the project to read current time form real-time clock. FF_NORTC_MON,
|
||||
/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() need to be added
|
||||
/ to the project to read current time form real-time clock. FF_NORTC_MON,
|
||||
/ FF_NORTC_MDAY and FF_NORTC_YEAR have no effect.
|
||||
/ These options have no effect in read-only configuration (FF_FS_READONLY = 1). */
|
||||
|
||||
|
||||
#define FF_FS_CRTIME 0
|
||||
/* This option enables(1)/disables(0) the timestamp of the file created. When
|
||||
/ set 1, the file created time is available in FILINFO structure. */
|
||||
|
||||
|
||||
#define FF_FS_NOFSINFO 0
|
||||
/* If you need to know correct free space on the FAT32 volume, set bit 0 of this
|
||||
/ option, and f_getfree() function at the first time after volume mount will force
|
||||
/* If you need to know the correct free space on the FAT32 volume, set bit 0 of
|
||||
/ this option, and f_getfree() on the first time after volume mount will force
|
||||
/ a full FAT scan. Bit 1 controls the use of last allocated cluster number.
|
||||
/
|
||||
/ bit0=0: Use free cluster count in the FSINFO if available.
|
||||
@@ -280,13 +297,13 @@
|
||||
/* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs
|
||||
/ module itself. Note that regardless of this option, file access to different
|
||||
/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
|
||||
/ and f_fdisk() function, are always not re-entrant. Only file/directory access
|
||||
/ to the same volume is under control of this featuer.
|
||||
/ and f_fdisk(), are always not re-entrant. Only file/directory access to
|
||||
/ the same volume is under control of this featuer.
|
||||
/
|
||||
/ 0: Disable re-entrancy. FF_FS_TIMEOUT have no effect.
|
||||
/ 1: Enable re-entrancy. Also user provided synchronization handlers,
|
||||
/ ff_mutex_create(), ff_mutex_delete(), ff_mutex_take() and ff_mutex_give()
|
||||
/ function, must be added to the project. Samples are available in ffsystem.c.
|
||||
/ ff_mutex_create(), ff_mutex_delete(), ff_mutex_take() and ff_mutex_give(),
|
||||
/ must be added to the project. Samples are available in ffsystem.c.
|
||||
/
|
||||
/ The FF_FS_TIMEOUT defines timeout period in unit of O/S time tick.
|
||||
*/
|
||||
|
||||
+7429
-12114
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user