summaryrefslogtreecommitdiff
path: root/fatfs/doc/en
diff options
context:
space:
mode:
Diffstat (limited to 'fatfs/doc/en')
-rw-r--r--fatfs/doc/en/appnote.html18
-rw-r--r--fatfs/doc/en/dinit.html6
-rw-r--r--fatfs/doc/en/dioctl.html19
-rw-r--r--fatfs/doc/en/dread.html9
-rw-r--r--fatfs/doc/en/dstat.html10
-rw-r--r--fatfs/doc/en/dwrite.html4
-rw-r--r--fatfs/doc/en/eof.html2
-rw-r--r--fatfs/doc/en/error.html2
-rw-r--r--fatfs/doc/en/filename.html14
-rw-r--r--fatfs/doc/en/getcwd.html2
-rw-r--r--fatfs/doc/en/mkfs.html48
-rw-r--r--fatfs/doc/en/mount.html2
-rw-r--r--fatfs/doc/en/rc.html6
-rw-r--r--fatfs/doc/en/readdir.html4
-rw-r--r--fatfs/doc/en/sfile.html2
-rw-r--r--fatfs/doc/en/sfileinfo.html4
-rw-r--r--fatfs/doc/en/stat.html40
17 files changed, 138 insertions, 54 deletions
diff --git a/fatfs/doc/en/appnote.html b/fatfs/doc/en/appnote.html
index 7f5ad89..fee2af9 100644
--- a/fatfs/doc/en/appnote.html
+++ b/fatfs/doc/en/appnote.html
@@ -54,7 +54,7 @@ The FatFs module assumes that size of char/short/long are 8/16/32 bit and int is
<tr><td>disk_write<br>get_fattime<br>disk_ioctl (CTRL_SYNC)</td><td>_FS_READONLY == 0</td></tr>
<tr><td>disk_ioctl (GET_SECTOR_COUNT)<br>disk_ioctl (GET_BLOCK_SIZE)</td><td>_USE_MKFS == 1</td></tr>
<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td>_MAX_SS != _MIN_SS</td></tr>
-<tr><td>disk_ioctl (CTRL_ERASE_SECTOR)</td><td>_USE_ERASE == 1</td></tr>
+<tr><td>disk_ioctl (CTRL_TRIM)</td><td>_USE_TRIM == 1</td></tr>
<tr><td>ff_convert<br>ff_wtoupper</td><td>_USE_LFN &gt;= 1</td><td>Unicode support functions.<br>Available in option/unicode.c.</td></tr>
<tr><td>ff_cre_syncobj<br>ff_del_syncobj<br>ff_req_grant<br>ff_rel_grant</td><td>_FS_REENTRANT == 1</td><td rowspan="2">O/S dependent functions.<br>Samples available in option/syscall.c.</td></tr>
<tr><td>ff_mem_alloc<br>ff_mem_free</td><td>_USE_LFN == 3</td></tr>
@@ -98,7 +98,7 @@ _USE_STRFUNC 0 (Disable string functions)
_USE_MKFS 0 (Disable f_mkfs function)
_USE_FORWARD 0 (Disable f_forward function)
_USE_FASTSEEK 0 (Disable fast seek feature)
-_CODE_PAGE 932 (Japanese Shift-JIS)
+_CODE_PAGE 932 (Japanese Shift_JIS)
_USE_LFN 0 (Disable LFN feature)
_MAX_SS 512 (Fixed sector size)
_FS_RPATH 0 (Disable relative path feature)
@@ -151,17 +151,17 @@ _FS_LOCK 0 (Disable file lock control)
<div class="para" id="lfn">
<h3>Long File Name</h3>
-<p>FatFs module supports LFN (long file name). The two different file names, SFN (short file name) and LFN, of a file is transparent on the API except for <tt>f_readdir()</tt> function. The LFN feature is disabled by default. To enable it, set <tt>_USE_LFN</tt> to 1, 2 or 3, and add <tt>option/unicode.c</tt> to the project. The LFN feature requiers a certain working buffer in addition. The buffer size can be configured by <tt>_MAX_LFN</tt> according to the available memory. The length of an LFN will reach up to 255 characters, so that the <tt>_MAX_LFN</tt> should be set to 255 for full featured LFN operation. If the size of working buffer is insufficient for the input file name, the file function fails with <tt>FR_INVALID_NAME</tt>. When enable the LFN feature with re-entrant configuration, <tt>_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 working buffer occupies <tt>(_MAX_LFN + 1) * 2</tt> bytes.</p>
+<p>FatFs module supports LFN (long file name). The two different file names, SFN (short file name) and LFN, of a file is transparent on the API except for <tt>f_readdir()</tt> function. The LFN feature is disabled by default. To enable it, set <tt>_USE_LFN</tt> to 1, 2 or 3, and add <tt>option/unicode.c</tt> to the project. The LFN feature requiers a certain working buffer in addition. The buffer size can be configured by <tt>_MAX_LFN</tt> according to the available memory. The length of an LFN will reach up to 255 characters, so that the <tt>_MAX_LFN</tt> should be set to 255 for full featured LFN operation. If the size of working buffer is insufficient for the input file name, the file function fails with <tt>FR_INVALID_NAME</tt>. When enable the LFN feature under re-entrant configuration, <tt>_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 working buffer occupies <tt>(_MAX_LFN + 1) * 2</tt> bytes.</p>
<table class="lst2 rset">
<caption>LFN cfg on ARM7TDMI</caption>
<tr><th>Code page</th><th>Program size</th></tr>
<tr><td>SBCS</td><td>+3.7K</td></tr>
-<tr><td>932(Shift-JIS)</td><td>+62K</td></tr>
+<tr><td>932(Shift_JIS)</td><td>+62K</td></tr>
<tr><td>936(GBK)</td><td>+177K</td></tr>
<tr><td>949(Korean)</td><td>+139K</td></tr>
<tr><td>950(Big5)</td><td>+111K</td></tr>
</table>
-<p>When the LFN feature is enabled, the module size will be increased depends on the selected code page. Right table shows how many bytes increased when LFN feature is enabled with 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 that shown in the table. As the result, the FatFs with LFN feature with those code pages will not able to be implemented to most 8-bit microcontrollers.</p>
+<p>When the LFN feature is enabled, the module size will be increased depends on the selected code page. Right table shows how many bytes increased when LFN feature is enabled with 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. As the result, the FatFs with LFN feature with those code pages will not able to be implemented to most 8-bit microcontrollers.</p>
<p>Note that the LFN feature on the FAT file system is a patent of Microsoft Corporation. This is not the case on FAT32 but most FAT32 drivers come with the LFN feature. FatFs can swich the LFN feature off by configuration option. When enable LFN feature on the commercial products, a license from Microsoft may be required depends on the final destination.</p>
</div>
@@ -181,7 +181,7 @@ _FS_LOCK 0 (Disable file lock control)
<div class="para" id="dup">
<h3>Duplicated File Access</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 and deleted. A violation of these rules can cause data colluption.</p>
-<p>The file lock control can also be available by <tt>_FS_LOCK</tt> option. The value defines the number of open objects to manage simultaneously. In this case, if any open, rename or remove that violating the file shareing rule that described above is attempted, the file function will fail with <tt>FR_LOCKED</tt>. If number of open objects, files and sub-directories, gets larger than <tt>_FS_LOCK</tt>, the <tt>f_open(), f_optndir()</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
+<p>The file lock control can be enabled by <tt>_FS_LOCK</tt> option. The value of option defines the number of open objects to manage simultaneously. In this case, if any open, rename or remove that violating the file shareing rule that described above is attempted, the file function will fail with <tt>FR_LOCKED</tt>. If number of open objects, files and sub-directories, is equal to <tt>_FS_LOCK</tt>, an extra <tt>f_open(), f_optndir()</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
</div>
<div class="para" id="fs1">
@@ -196,7 +196,7 @@ _FS_LOCK 0 (Disable file lock control)
<p>Figure 3. Fully sector aligned read<br>
<img src="../img/f3.png" width="490" height="119" alt="">
</p>
-<p>The file I/O buffer is a sector buffer to read/write a partial data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the file system object. The buffer configuration option <tt>_FS_TINY</tt> determins which sector buffer is used for the file data transfer. When tiny buffer (1) is selected, data memory consumption is reduced 512 bytes each file object. In this case, FatFs module uses only a sector buffer in the file system 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>The file I/O buffer is a sector buffer to read/write a partial data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the file system object. The buffer configuration option <tt>_FS_TINY</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>_MAX_SS</tt> bytes each file object. In this case, FatFs module uses only a sector buffer in the file system 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 misaligned 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>
@@ -211,7 +211,7 @@ Figure 6. Comparison between Multiple/Single Sector Write<br>
</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. This effect more appers at faster interface speed and the performance ratio often becomes grater than ten. <a href="../img/rwtest2.png">This graph</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. The number of write transactions also affects the life time of the flash memory media. 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 disk 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 feature. </p>
<h4>Forcing Memory Erase</h4>
-<p>When remove a file with <tt>f_remove()</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 is forced erased on removing the file, those data blocks will be turned in to 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 feature by setting <tt>_USE_ERASE</tt> to 1. Note that this is an expectation of internal process of the flash memory storage and not that always effective. Also <tt>f_remove()</tt> function will take a time when remove a large file. Most applications will not need this feature.</p>
+<p>When remove a file with <tt>f_remove()</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 is forced erased on removing the file, those data blocks will be turned in to 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 feature by setting <tt>_USE_TRIM</tt> to 1. Note that this is an expectation of internal process of the flash memory storage and not that always effective. Also <tt>f_remove()</tt> function will take a time when remove a large file. Most applications will not need this feature.</p>
</div>
<div class="para" id="critical">
@@ -267,7 +267,7 @@ Figure 5. Minimized critical section<br>
/ * Redistributions of source code must retain the above copyright notice.
/
/-----------------------------------------------------------------------------/</pre>
-<p>Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. Because FatFs is for embedded projects, the conditions of redistributions in binary form, such as embedded code, hex file, binary library or any forms without source code, are not specified in order to extend usability for commercial products. The documentation of the distributions need not include about FatFs and its license document, and it may also. This is equivalent to the BSD 1-Clause License. Of course FatFs is compatible with the projects under GNU GPL. When redistribute the FatFs with any modification or branch it as a folk, the license can also be changed to GNU GPL or BSD-style license.</p>
+<p>Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. Because FatFs is mainly intended for embedded projects, the redistributions in binary form, such as embedded code or any forms without source code, need not to explain about FatFs in order to extend usability for commercial products. The documentation of the distributions need not include about FatFs and its license documents, and it may also. This is equivalent to the BSD 1-Clause License. Of course FatFs is compatible with the projects under GNU GPL. When redistribute the FatFs with any modification or branch it as a fork, the license can also be changed to GNU GPL, BSD-style license or any free software licenses that not conflict with FatFs license.</p>
</div>
<p class="foot"><a href="../00index_e.html">Return</a></p>
diff --git a/fatfs/doc/en/dinit.html b/fatfs/doc/en/dinit.html
index c22df47..a85eecd 100644
--- a/fatfs/doc/en/dinit.html
+++ b/fatfs/doc/en/dinit.html
@@ -25,19 +25,19 @@ DSTATUS disk_initialize (
<h4>Parameter</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Physical drive number to identify the target device.</dd>
+<dd>Physical drive number to identify the target device. Always zero at single drive system.</dd>
</dl>
</div>
<div class="para ret">
<h4>Return Values</h4>
-<p>This function returns a disk status as the result. For details of the disk status, refer to the <a href="dstat.html">disk_status()</a> function.</p>
+<p>This function returns the current drive status flags as the result. For details of the drive status, refer to the <a href="dstat.html">disk_status()</a> function.</p>
</div>
<div class="para desc">
<h4>Description</h4>
-<p>This function initializes a storage device and put it ready to generic read/write data. When the function succeeded, <tt>STA_NOINIT</tt> flag in the return value is cleared.</p>
+<p>This function initializes the storage device and put it ready to generic read/write. When the function succeeded, <tt>STA_NOINIT</tt> flag in the return value is cleared.</p>
<p><em>Application program MUST NOT call this function, or FAT structure on the volume can be broken. To re-initialize the file system, use <tt>f_mount()</tt> function instead.</em> This function is called at volume mount process by FatFs module to manage the media change.</p>
</div>
diff --git a/fatfs/doc/en/dioctl.html b/fatfs/doc/en/dioctl.html
index 8cd30af..8fe62ec 100644
--- a/fatfs/doc/en/dioctl.html
+++ b/fatfs/doc/en/dioctl.html
@@ -57,19 +57,19 @@ DRESULT disk_ioctl (
<table class="lst">
<caption>Standard ioctl command used by FatFs</caption>
<tr><th>Command</th><th>Description</th></tr>
-<tr><td>CTRL_SYNC</td><td>Make sure that the device has finished pending write process. If the disk I/O module has a write back cache, the dirty buffers must be written back to the media immediately. Nothing to do for this command if each write operation to the media is completed within the <tt>disk_write()</tt> function. Required at <tt>_FS_READONLY == 0</tt>.</td></tr>
+<tr><td>CTRL_SYNC</td><td>Make sure that the device has finished pending write process. If the disk I/O module has a write back cache, the dirty buffers must be written back to the media immediately. Nothing to do for this command if each write operation to the media is completed within the <tt>disk_write()</tt> function.</td></tr>
<tr><td>GET_SECTOR_COUNT</td><td>Returns number of available sectors on the drive into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. This command is used by only <tt>f_mkfs()</tt> and <tt>f_fdisk()</tt> function to determine the volume/partition size to be created. Required at <tt>_USE_MKFS == 1</tt> or <tt>_MULTI_PARTITION == 1</tt>.</td></tr>
-<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the media into the <tt>WORD</tt> variable pointed by <tt class="arg">buff</tt>. Valid return values of this command are 512, 1024, 2048 or 4096. This command is required at variable sector size configuration, <tt>_MAX_SS &gt; _MIN_SS</tt>. Never used at fixed sector size configuration, <tt>_MAX_SS == _MIN_SS</tt>, and it must work at that sector size.</td></tr>
-<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the flash memory in unit of sector into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. The allowable value is from 1 to 32768 in power of 2. Return 1 if the erase block size is unknown or disk media. This command is used by only <tt>f_mkfs()</tt> function and it attempts to align data area to the erase block boundary. Required at <tt>_USE_MKFS == 1</tt>.</td></tr>
-<tr><td>CTRL_ERASE_SECTOR</td><td>Informs device that the data on the block of sectors specified by a <tt>DWORD</tt> array {&lt;start sector&gt;, &lt;end sector&gt;} pointed by <tt class="arg">buff</tt> is no longer needed and may be erased. The device would force erased the memory block. This is a command similar to Trim command of ATA device. When this feature is not supported or not a flash memory media, nothing to do for this command. The FatFs does not check the result code and the file function is not affected even if the sectors ware not erased well. This command is called on removing a cluster chain and <tt>f_mkfs()</tt> function. Required at <tt>_USE_ERASE == 1</tt>.</td></tr>
+<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the media into the <tt>WORD</tt> variable pointed by <tt class="arg">buff</tt>. Valid return values of this command are 512, 1024, 2048 and 4096. This command is required only at variable sector size configuration, <tt>_MAX_SS &gt; _MIN_SS</tt>. At fixed sector size configuration, <tt>_MAX_SS == _MIN_SS</tt>, this command is not used and the device must work at that sector size.</td></tr>
+<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the flash memory media in unit of sector into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. The allowable value is from 1 to 32768 in power of 2. Return 1 if the erase block size 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 to the erase block boundary. Required at <tt>_USE_MKFS == 1</tt>.</td></tr>
+<tr><td>CTRL_TRIM</td><td>Informs the device the data on the block of sectors that specified by <tt>DWORD</tt> array {&lt;start sector&gt;, &lt;end sector&gt;} pointed by <tt class="arg">buff</tt> is no longer needed and it may be erased. This is an identical command to Trim of ATA device. When this feature is not supported or not a flash memory device, nothing to do for this command. The 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 removing a cluster chain and <tt>f_mkfs()</tt> function. Required at <tt>_USE_TRIM == 1</tt>.</td></tr>
</table>
-<p>FatFs never uses any device dependent command and user defined command. Following table shows an example of non-standard commands usable for some applications.</p>
+<p>FatFs never uses any device dependent command nor user defined command. Following table shows an example of non-standard commands usable for some applications.</p>
<table class="lst">
<caption>Example of optional ioctl command</caption>
<tr><th>Command</th><th>Description</th></tr>
<tr><td>CTRL_FORMAT</td><td>Create a physical format on the media. If <tt class="arg">buff</tt> is not null, it is pointer to the call-back function for progress notification.</td></tr>
-<tr><td>CTRL_POWER_IDLE</td><td>Put the device idle state. <tt>STA_NOINIT</tt> in status flag may not be set if the device would go active state by generic read/write function.</td></tr>
+<tr><td>CTRL_POWER_IDLE</td><td>Put the device idle state. <tt>STA_NOINIT</tt> in status flag may not be set if the device goes active state by generic read/write function.</td></tr>
<tr><td>CTRL_POWER_OFF</td><td>Put the device off state. Shut-down the power to the device and deinitialize the device interface if needed. <tt>STA_NOINIT</tt> in status flag must be set. The device goes active state by <tt>disk_initialize()</tt> function.</td></tr>
<tr><td>CTRL_LOCK</td><td>Lock media eject mechanism.</td></tr>
<tr><td>CTRL_UNLOCK</td><td>Unlock media eject mechanism.</td></tr>
@@ -85,6 +85,13 @@ DRESULT disk_ioctl (
</table>
</div>
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>The disk_ioctl function is not needed when <tt>_FS_READONLY == 1</tt> and <tt>_MAX_SS == _MIN_SS</tt>.</p>
+</div>
+
+
<p class="foot"><a href="../00index_e.html">Return</a></p>
</body>
</html>
diff --git a/fatfs/doc/en/dread.html b/fatfs/doc/en/dread.html
index f81cf90..2e7c279 100644
--- a/fatfs/doc/en/dread.html
+++ b/fatfs/doc/en/dread.html
@@ -32,9 +32,9 @@ DRESULT disk_read (
<dt>buff</dt>
<dd>Pointer to the <em>byte array</em> to store the read data.</dd>
<dt>sector</dt>
-<dd>Start sector number in logical block address (LBA).</dd>
+<dd>Start sector number in 32-bit LBA.</dd>
<dt>count</dt>
-<dd>Number of sectors to read. FatFs specifis it in range of from 1 to 128.</dd>
+<dd>Number of sectors to read in range of from 1 to 128..</dd>
</dl>
</div>
@@ -56,9 +56,10 @@ DRESULT disk_read (
<div class="para desc">
<h4>Description</h4>
-<p>The memory address specified by <tt class="arg">buff</tt> is not that always aligned to word boundary because the type of argument is defined as <tt>BYTE*</tt>. The misaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow misaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>
+<p>The data read/write operation to the storage devices is done in unit of <em>sector</em>. FatFs supports the sector size in range of from 512 to 4096 bytes. When FatFs is configured to fixed sector size (<tt>_MIN_SS == MAX_SS</tt>, this will be the most case), the read/write function must work at that sector size. If variable sector size is selected (<tt>_MIN_SS &lt; MAX_SS</tt>), FatFs inquires the sector size with <tt>disk_ioctl()</tt> after initialization</tt>.
+<p>The memory address specified by <tt class="arg">buff</tt> is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. The misaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow misaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>
<ul>
-<li>Convert word transfer to byte transfer in this function. - Recommended.</li>
+<li>Convert word transfer to byte transfer in this function if needed. - Recommended.</li>
<li>For <tt>f_read()</tt>, avoid long read request that includes a whole of sector. - Direct transfer will never occure.</li>
<li>For <tt>f_read(fp, buff, btr, &amp;br)</tt>, make sure that <tt>(((UINT)buff &amp; 3) == (f_tell(fp) &amp; 3))</tt> is true. - Word aligned direct transfer is guaranteed.</li>
</ul>
diff --git a/fatfs/doc/en/dstat.html b/fatfs/doc/en/dstat.html
index 5ae2775..c8204cc 100644
--- a/fatfs/doc/en/dstat.html
+++ b/fatfs/doc/en/dstat.html
@@ -13,7 +13,7 @@
<div class="para func">
<h2>disk_status</h2>
-<p>The disk_status function returns the current disk status.</p>
+<p>The disk_status function returns the current drive status.</p>
<pre>
DSTATUS disk_status (
BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] Physical drive number */</span>
@@ -25,21 +25,21 @@ DSTATUS disk_status (
<h4>Parameter</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Physical drive number to identify the target device.</dd>
+<dd>Physical drive number to identify the target device. Always zero at single drive system.</dd>
</dl>
</div>
<div class="para ret">
<h4>Return Values</h4>
-<p>The disk status is returned in combination of following flags. FatFs refers only <tt>STA_NOINIT</tt> and <tt>STA_PROTECT</tt>.</p>
+<p>The current drive status is returned in combination of status flags described below. FatFs refers only <tt>STA_NOINIT</tt> and <tt>STA_PROTECT</tt>.</p>
<dl class="ret">
<dt>STA_NOINIT</dt>
-<dd>Indicates that the device is not initialized. This flag is set on system reset, media removal or failure of <tt>disk_initialize()</tt> function. It is cleared on <tt>disk_initialize()</tt> function succeeded. Media change that occurs asynchronously must be captured and reflect it to the status flags, or auto-mount feature will not work correctly. When media change detection feature is not supported, application program needs to de-initialize the file system object with <tt>f_mount()</tt> function after the media change.</dd>
+<dd>Indicates that the device is not initialized. This flag is set on system reset, media removal or failure of <tt>disk_initialize()</tt> function. It is cleared on <tt>disk_initialize()</tt> function succeeded. Media change that occurs asynchronously must be captured and reflect it to the status flags, or auto-mount feature will not work correctly. If the system does not support media change detect feature, application program needs to force de-initialize the file system object with <tt>f_mount()</tt> function after the media change.</dd>
<dt>STA_NODISK</dt>
<dd>Indicates that no medium in the drive. This is always cleared on fixed disk drive. Note that FatFs does not refer this flag.</dd>
<dt>STA_PROTECT</dt>
-<dd>Indicates that the medium is write protected. This is always cleared on the drives without write protect feature. Not valid while no medium in the drive.</dd>
+<dd>Indicates that the medium is write protected. This is always cleared on the drives without write protect feature. Not valid if no medium in the drive.</dd>
</dl>
</div>
diff --git a/fatfs/doc/en/dwrite.html b/fatfs/doc/en/dwrite.html
index 67e3310..fd4bf48 100644
--- a/fatfs/doc/en/dwrite.html
+++ b/fatfs/doc/en/dwrite.html
@@ -32,9 +32,9 @@ DRESULT disk_write (
<dt>buff</dt>
<dd>Pointer to the <em>byte array</em> to be written. The size of data to be written is sector size * <tt class="arg">count</tt> bytes.</dd>
<dt>sector</dt>
-<dd>Start sector number in logical block address (LBA).</dd>
+<dd>Start sector number in 32-bit LBA.</dd>
<dt>count</dt>
-<dd>Number of sectors to write. FatFs specifis it in range of from 1 to 128.</dd>
+<dd>Number of sectors to write in range of from 1 to 128.</dd>
</dl>
</div>
diff --git a/fatfs/doc/en/eof.html b/fatfs/doc/en/eof.html
index 384c8d8..337697b 100644
--- a/fatfs/doc/en/eof.html
+++ b/fatfs/doc/en/eof.html
@@ -41,7 +41,7 @@ int f_eof (
<h4>Description</h4>
<p>In this revision, this function is implemented as a macro.</p>
<pre>
-<span class="k">#define</span> f_eof(fp) (((fp)->fptr) == ((fp)->fsize) ? 1 : 0)
+<span class="k">#define</span> f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
</pre>
</div>
diff --git a/fatfs/doc/en/error.html b/fatfs/doc/en/error.html
index 7405d9e..a14deb1 100644
--- a/fatfs/doc/en/error.html
+++ b/fatfs/doc/en/error.html
@@ -41,7 +41,7 @@ int f_error (
<h4>Description</h4>
<p>In this revision, this function is implemented as a macro.</p>
<pre>
-<span class="k">#define</span> f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
+<span class="k">#define</span> f_error(fp) ((fp)->flag)
</pre>
</div>
diff --git a/fatfs/doc/en/filename.html b/fatfs/doc/en/filename.html
index 1209947..49dcc2d 100644
--- a/fatfs/doc/en/filename.html
+++ b/fatfs/doc/en/filename.html
@@ -17,9 +17,9 @@
<p>The format of path name on the FatFs module is similer to the filename 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 LFN feature is enabled (<tt>_USE_LFN &gt; 0</tt>). The sub directories are separated with a \ or / in the same way as DOS/Windows API. Duplicated separators are skipped and ignored. Only a difference is that the logical drive is specified in a numeral with a colon. When drive number is omitted, the drive number is assumed as <em>default drive</em> (drive 0 or current drive).</p>
-<p>Control characters (<tt>'\0'</tt> to <tt>'\x1F'</tt>) are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name at LFN configuration but they are recognized as end of the path name at non-LFN configuration. Trailing spaces and dots are ignored.</p>
+<p>Control characters (<tt>'\0'</tt> to <tt>'\x1F'</tt>) are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name at LFN configuration but the space is recognized as end of the path name at non-LFN configuration. Trailing spaces and dots are ignored at both configurations.</p>
<p>In default configuration (<tt>_FS_RPATH == 0</tt>), it does not have a concept of current directory like OS oriented file system. All objects on the volume are always specified in full path name that follows from the root directory. Dot directory names 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>_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 drive set with <a href="chdir.html">f_chdir</a> function. Dot names are also allowed for the path name. The default drive is the current drive set with <a href="chdrive.html">f_chdrive</a> function.</p>
+<p>When relative path feature is enabled (<tt>_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 drive set by <a href="chdir.html">f_chdir</a> function. Dot names are also allowed for the path name. The default drive is the current drive set by <a href="chdrive.html">f_chdrive</a> function.</p>
<table class="lst2">
<tr><td>Path name</td><td>_FS_RPATH == 0</td><td>_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>
@@ -35,13 +35,13 @@
<tr><td>dir1/..</td><td>Invalid name</td><td>The current directory</td></tr>
<tr><td>/..</td><td>Invalid name</td><td>The root directory (sticks the top level)</td></tr>
</table>
-<p>When option <tt>_STR_VOLUME_ID</tt> is specified, also pre-defined strings can be used as drive identifier in the path name instead of a numeral.</p>
+<p>When option <tt>_STR_VOLUME_ID</tt> is specified, also pre-defined strings can be used as drive identifier in the path name instead of a numeral. e.g. <tt>"sd:file1.txt"</tt> or <tt>"ram:swapfile.dat"</tt>.</p>
</div>
<p><br></p>
<div class="para" id="uni">
<h3>Unicode API</h3>
-<p>The path names are input/output in either ANSI/OEM code (SBCS/DBCS) or Unicode depends on the configuration options. The type of arguments which specify the file names are defined as <tt>TCHAR</tt>. It is an alias of <tt>char</tt> in default. The code set used to the file name string is ANSI/OEM specifid by <tt>_CODE_PAGE</tt>. When <tt>_LFN_UNICODE</tt> is set to 1, the type of the <tt>TCHAR</tt> is switched to <tt>WCHAR</tt> to support Unicode (UTF-16 encoding). In this case, the LFN feature is fully supported and the Unicode specific characters, such as ✝☪✡☸☭, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
+<p>The path names are input/output in either ANSI/OEM code or Unicode depends on the configuration options. The type of arguments which specify the path names are defined as <tt>TCHAR</tt>. It is an alias of <tt>char</tt> by default. The code set used to the path name string is ANSI/OEM specifid by <tt>_CODE_PAGE</tt>. When <tt>_LFN_UNICODE</tt> is set to 1, the type of the <tt>TCHAR</tt> is switched to <tt>WCHAR</tt> to support Unicode (UTF-16 encoding). In this case, the LFN feature is fully supported and the Unicode specific characters, such as ✝☪✡☸☭, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
<pre>
f_open(fp, "filename.txt", FA_READ); <span class="c">/* ANSI/OEM string */</span>
f_open(fp, L"filename.txt", FA_READ); <span class="c">/* Unicode string */</span>
@@ -64,13 +64,13 @@ PARTITION VolToPart[] = {
{0, 3}, <span class="c">/* Logical drive 2 ==> Physical drive 0, 3rd partition */</span>
{1, 0} <span class="c">/* Logical drive 3 ==> Physical drive 1 (auto detection) */</span>
};
-
-<img src="../img/f7.png" width="828" height="288" alt="relationship between logical drive and physical drive">
</pre>
+<div><img src="../img/f7.png" width="828" height="288" alt="relationship between logical drive and physical drive"></div>
<p>There are some considerations on using <tt>_MULTI_PARTITION</tt> configuration.</p>
<ul>
-<li>Only four primary partitions can be specified. Logical partition is not supported.</li>
<li>The physical drive that has two or more mounted partitions must be non-removable. Media change while a system operation is prohibited.</li>
+<li>Only four primary partitions can be specified. Extended partition is not supported.</li>
+<li>Windows does not support multiple volumes on the removable storage. Only first parition will be mounted.</li>
</ul>
</div>
diff --git a/fatfs/doc/en/getcwd.html b/fatfs/doc/en/getcwd.html
index df84287..045cce4 100644
--- a/fatfs/doc/en/getcwd.html
+++ b/fatfs/doc/en/getcwd.html
@@ -28,7 +28,7 @@ FRESULT f_getcwd (
<dt>buff</dt>
<dd>Pointer to the buffer to receive the current directory string.</dd>
<dt>len</dt>
-<dd>Size of the buffer in unit of TCHAR.</dd>
+<dd>Size of the buffer in unit of <tt>TCHAR</tt>.</dd>
</dl>
</div>
diff --git a/fatfs/doc/en/mkfs.html b/fatfs/doc/en/mkfs.html
index 573bdd7..5f733fa 100644
--- a/fatfs/doc/en/mkfs.html
+++ b/fatfs/doc/en/mkfs.html
@@ -31,7 +31,7 @@ FRESULT f_mkfs (
<dt>sfd</dt>
<dd>Specifies partitioning rule (FDISK(0) or SFD(1)). This argument will be ignored on some case.</dd>
<dt>au</dt>
-<dd>Specifies size of the allocation unit (cluter) in unit of byte. The value must be sector size * n (n is 1 to 128 and power of 2). When a zero is given, the cluster size is determined depends on the volume size.</dd>
+<dd>Specifies size of the allocation unit (cluter) in number of bytes or sectors. When the value is from 1 to 128, it specifies number of sectors. When the value is <tt>&gt;= _MIN_SS</tt>, it specifies number of bytes. If any invalid value, zero or not power of 2, is given, the cluster size is automatically determined depends on the volume size.</dd>
</dl>
</div>
@@ -51,11 +51,11 @@ FRESULT f_mkfs (
<div class="para desc">
<h4>Description</h4>
-<p>The <tt>f_mkfs()</tt> function creates an FAT volume on the logical drive. When FDISK format is specified, a primary partition occupies the entire disk space is created and then an FAT volume is created on the partition. When SFD format is specified, the FAT volume starts from the first sector of the physical drive.</p>
-<p>If the logical drive has been bound to any partition (1-4) by multiple partition feature (<tt>_MULTI_PARTITION</tt>), the FAT volume is created into the specified partition. In this case, the second argument <tt class="arg">sfd</tt> is ignored. The physical drive must have been partitioned with <tt>f_fdisk()</tt> function or any other partitioning tool prior to use this function.</p>
-<p>Note that there are two partitioning rules, FDISK and SFD. The FDISK partitioning is usually used for harddisk, MMC, SDC, CFC and U Disk. It can divide a physical drive into one or more partitions with a partition table on the MBR. However Windows does not support multiple partition on the removable media. The SFD is non-partitioned method. The FAT volume starts from the first sector on the physical drive without partition table. It is usually used for floppy disk, Microdrive, optical disk and super-floppy media.</p>
-<p>The FAT sub-type, FAT12/FAT16/FAT32, is determined by number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus which FAT sub-type is selected, is depends on the volume size and the specified cluster size. The cluster size affects performance of the file system and large cluster increases the performance.</p>
-<p>When the number of clusters gets near the FAT sub-type boundaries, the function can fail with <tt>FR_MKFS_ABORTED</tt>.</p>
+<p>The <tt>f_mkfs()</tt> function creates an FAT volume on the specified logical drive. When FDISK format is specified, a primary partition occupies entire space of the physical drive is created and then an FAT volume is created on the partition. When SFD format is specified, the FAT volume starts from the first sector of the physical drive.</p>
+<p>If the logical drive is bound to the specific partition (1-4) by multiple partition feature (<tt>_MULTI_PARTITION</tt>), the FAT volume is created into the partition. In this case, the second argument <tt class="arg">sfd</tt> is ignored. The physical drive must have been partitioned with <tt>f_fdisk()</tt> function or any other partitioning tools prior to create the FAT volume with this function.</p>
+<p>Note that there are two partitioning rules, FDISK and SFD. The FDISK partitioning is usually used for harddisk, MMC, SDC, CFC and U Disk. It can divide a physical drive into one or more partitions with a partition table on the MBR. However Windows does not support multiple partition on the removable disk. The SFD is non-partitioned method. The FAT volume starts from the first sector on the physical drive without partition table. It is usually used for floppy disk, Microdrive, optical disk and any type of super-floppy media.</p>
+<p>The FAT sub-type, FAT12/FAT16/FAT32, is determined by number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus which FAT sub-type is selected, is depends on the volume size and the specified cluster size. The cluster size affects read/write throughput and space usage efficiency. Larger cluster size increases the read/write throughput and decreases the space usage efficiency of the volume.</p>
+<p>In case of the number of clusters gets near the FAT sub-type boundaries, the function can fail with <tt>FR_MKFS_ABORTED</tt>.</p>
</div>
<div class="para comp">
@@ -63,6 +63,42 @@ FRESULT f_mkfs (
<p>Available when <tt>_FS_READOLNY == 0</tt> and <tt>_USE_MKFS == 1</tt>.</p>
</div>
+<div class="para use">
+<h4>Example</h4>
+<pre>
+<span class="c">/* Format the default drive */</span>
+int main (void)
+{
+ FATFS fs; <span class="c">/* File system object (volume work area) */</span>
+ FIL fil; <span class="c">/* File object */</span>
+ FRESULT res; <span class="c">/* API result code */</span>
+ UINT bw; <span class="c">/* Bytes written */</span>
+
+
+ <span class="c">/* Register work area */</span>
+ f_mount(&amp;fs, "", 0);
+
+ <span class="c">/* Create FAT volume with default cluster size */</span>
+ res = f_mkfs("", 0, 0);
+ if (res) ...
+
+ <span class="c">/* Create a file as new */</span>
+ res = f_open(&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);
+ if (bw != 15) ...
+
+ <span class="c">/* Close the file */</span>
+ f_close(&fil);
+
+ <span class="c">/* Unregister work area */</span>
+ f_mount(0, "", 0);
+
+</pre>
+</div>
+
<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="filename.html#vol">Volume management</a>, <a href="fdisk.html">f_fdisk</a></tt></p>
diff --git a/fatfs/doc/en/mount.html b/fatfs/doc/en/mount.html
index c4a00fc..0edb73a 100644
--- a/fatfs/doc/en/mount.html
+++ b/fatfs/doc/en/mount.html
@@ -62,7 +62,7 @@ FRESULT f_mount (
<li>File system object is not initialized. It is cleared by <tt>f_mount()</tt>.</li>
<li>Physical drive is not initialized. It is de-initialized by system reset or media removal.</li>
</ul>
-<p>If the function with forced mount failed, it means that the file system object is registered but the volume is currently not available. Mount process will also be attempted in subsequent file access functions.</p>
+<p>If the function with forced mount failed, it means that the file system object has been registered successfully but the volume is currently not ready to use. Mount process will also be attempted in subsequent file access functions.</p>
<p>If implementation of the disk I/O layer lacks media change detection, application program needs to perform a <tt>f_mount()</tt> after each media change to force cleared the file system object.</p>
</div>
diff --git a/fatfs/doc/en/rc.html b/fatfs/doc/en/rc.html
index c93479e..306671a 100644
--- a/fatfs/doc/en/rc.html
+++ b/fatfs/doc/en/rc.html
@@ -21,7 +21,7 @@
<dt id="ie">FR_INT_ERR</dt>
<dd>Assertion failed. An insanity is detected in the internal process. One of the following possibilities is suspected.
<ul>
-<li>Work area (file system object, file object or etc...) is broken by stack overflow or any other application. This is the reason in most case.</li>
+<li>Work area (file system object, file object or etc...) has been broken by stack overflow or any other tasks. This is the reason in most case.</li>
<li>There is any error of the FAT structure on the volume.</li>
</ul>
Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.
@@ -51,7 +51,7 @@ Note that if once this error occured at any operation to an open file, the file
<dt id="io">FR_INVALID_OBJECT</dt>
<dd>The file/directory object structure is invalid or a null pointer is given. All open objects of the logical drive are invalidated by the voulme mount process.</dd>
<dt id="wp">FR_WRITE_PROTECTED</dt>
-<dd>Any write mode action against the write-protected media.</dd>
+<dd>Any write mode operation against the write-protected media.</dd>
<dt id="id">FR_INVALID_DRIVE</dt>
<dd>Invalid drive number is specified in the path name. A null pointer is given as the path name. (Related option: <tt>_VOLUMES</tt>)</dd>
<dt id="ne">FR_NOT_ENABLED</dt>
@@ -74,7 +74,7 @@ Note that if once this error occured at any operation to an open file, the file
<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>_USE_LFN</tt>)</li>
-<li>Size of the given CLMT buffer is insufficient for the file fragments.</li>
+<li>Size of the given buffer is insufficient for the size required.</li>
</ul>
</dd>
<dt id="tf">FR_TOO_MANY_OPEN_FILES</dt>
diff --git a/fatfs/doc/en/readdir.html b/fatfs/doc/en/readdir.html
index 9808435..bf83ebe 100644
--- a/fatfs/doc/en/readdir.html
+++ b/fatfs/doc/en/readdir.html
@@ -77,7 +77,7 @@ FRESULT scan_files (
FILINFO fno;
DIR dir;
int i;
- char *fn; <span class="c">/* This function is assuming non-Unicode cfg. */</span>
+ char *fn; <span class="c">/* This function assumes non-Unicode configuration */</span>
<span class="k">#if</span> _USE_LFN
static char lfn[_MAX_LFN + 1]; <span class="c">/* Buffer to store the LFN */</span>
fno.lfname = lfn;
@@ -100,8 +100,8 @@ FRESULT scan_files (
if (fno.fattrib &amp; AM_DIR) { <span class="c">/* It is a directory */</span>
sprintf(&amp;path[i], "/%s", fn);
res = scan_files(path);
- if (res != FR_OK) break;
path[i] = 0;
+ if (res != FR_OK) break;
} else { <span class="c">/* It is a file. */</span>
printf("%s/%s\n", path, fn);
}
diff --git a/fatfs/doc/en/sfile.html b/fatfs/doc/en/sfile.html
index e6edf70..1ed9899 100644
--- a/fatfs/doc/en/sfile.html
+++ b/fatfs/doc/en/sfile.html
@@ -13,7 +13,7 @@
<div class="para">
<h2>FIL</h2>
-<p>The <tt>FIL</tt> structure (file object) holds state of an open file. It is created by <tt>f_open()</tt> function and discarded by <tt>f_close()</tt> function. Application program must not modify any member in this structure except for <tt>cltbl</tt>. Note that a sector buffer is defined in this structure at non-tiny configuration, so that the <tt>FIL</tt> structures should not be defined as auto variable.</p>
+<p>The <tt>FIL</tt> structure (file object) holds the state of an open file. It is created by <tt>f_open()</tt> function and discarded by <tt>f_close()</tt> function. Application program must not modify any member in this structure except for <tt>cltbl</tt>. Note that a sector buffer is defined in this structure at non-tiny configuration (<tt>_FS_TINY == 0</tt>), so that the <tt>FIL</tt> structures at that configuration should not be defined as auto variable.</p>
<pre>
<span class="k">typedef</span> <span class="k">struct</span> {
diff --git a/fatfs/doc/en/sfileinfo.html b/fatfs/doc/en/sfileinfo.html
index 5674086..ac254a1 100644
--- a/fatfs/doc/en/sfileinfo.html
+++ b/fatfs/doc/en/sfileinfo.html
@@ -60,9 +60,9 @@
<dt>fname[]</dt>
<dd>Indicates the file/directory name in 8.3 format null-terminated string. It is always returnd with upper case in non-LFN configuration but it can be returned with lower case in LFN configuration.</dd>
<dt>lfname</dt>
-<dd>Pointer to the LFN buffer to store the read LFN. This member must be initialized by application prior to use this structure. Set null pointer if LFN is not needed. Not available in non-LFN configuration.</dd>
+<dd>Pointer to the LFN buffer to store the read LFN. This member must be initialized by application program prior to use this structure. Set a null pointer if LFN is not needed. Not available at non-LFN configuration.</dd>
<dt>lfsize</dt>
-<dd>Size of the LFN buffer in unit of TCHAR. This member must be initialized by application prior to use this structure. Not available in non-LFN configuration.</dd>
+<dd>Size of the LFN buffer in unit of TCHAR. This member must be initialized by application program prior to use this structure. Not available at non-LFN configuration.</dd>
</dl>
<p class="foot"><a href="../00index_e.html">Return</a></p>
diff --git a/fatfs/doc/en/stat.html b/fatfs/doc/en/stat.html
index 8ea343b..db53c5d 100644
--- a/fatfs/doc/en/stat.html
+++ b/fatfs/doc/en/stat.html
@@ -55,6 +55,7 @@ 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. If not exist, the function returns with <tt>FR_NO_FILE</tt>. If exist, the function returns with <tt>FR_OK</tt> and the informations of the object, file size, timestamp, attribute and SFN, are 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>When LFN feature is enabled, <tt>lfname</tt> in the file information structure must be NULLed prior to use it.</p>
</div>
@@ -64,6 +65,45 @@ FRESULT f_stat (
</div>
+<div class="para use">
+<h4>Example</h4>
+<pre>
+ FRESULT fr;
+ FILINFO fno;
+
+
+ printf("Test for 'file.txt'...\n");
+
+<span class="k">#if</span> _USE_LFN
+ fno.lfname = 0;
+<span class="k">#endif</span>
+ fr = f_stat("file.txt", &amp;fno);
+ switch (fr) {
+
+ case FR_OK:
+ printf("Size: %u\n", fno.fsize);
+ printf("Timestamp: %u/%02u/%02u, %02u:%02u\n",
+ (fno.fdate &gt;&gt; 9) + 1980, fno.fdate &gt;&gt; 5 &amp; 15, fno.fdate &amp; 31,
+ fno.ftime &gt;&gt; 11, fno.ftime &gt;&gt; 5 &amp; 63);
+ printf("Attributes: %c%c%c%c%c\n",
+ (fno.fattrib & AM_DIR) ? 'D' : '-',
+ (fno.fattrib & AM_RDO) ? 'R' : '-',
+ (fno.fattrib & AM_HID) ? 'H' : '-',
+ (fno.fattrib & AM_SYS) ? 'S' : '-',
+ (fno.fattrib & AM_ARC) ? 'A' : '-');
+ break;
+
+ case FR_NO_FILE:
+ printf("It is not exist.\n");
+ break;
+
+ default:
+ printf("An error occured. (%d)\n", fr);
+ }
+</pre>
+</div>
+
+
<div class="para ref">
<h4>References</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>