summaryrefslogtreecommitdiff
path: root/fatfs/documents/doc/readdir.html
diff options
context:
space:
mode:
Diffstat (limited to 'fatfs/documents/doc/readdir.html')
-rw-r--r--fatfs/documents/doc/readdir.html25
1 files changed, 17 insertions, 8 deletions
diff --git a/fatfs/documents/doc/readdir.html b/fatfs/documents/doc/readdir.html
index 878cb02..52a96b9 100644
--- a/fatfs/documents/doc/readdir.html
+++ b/fatfs/documents/doc/readdir.html
@@ -20,6 +20,11 @@ FRESULT f_readdir (
FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] File information structure */</span>
);
</pre>
+<pre>
+FRESULT f_rewinddir (
+ DIR* <span class="arg">dp</span> <span class="c">/* [IN] Directory object */</span>
+);
+</pre>
</div>
<div class="para arg">
@@ -48,15 +53,19 @@ FRESULT f_readdir (
<div class="para desc">
<h4>Description</h4>
-<p>The <tt>f_readdir</tt> function reads a directory item, informations about the object. All items in the directory can be read in sequence by <tt>f_readdir</tt> function calls. Dot entries (<tt>"."</tt> and <tt>".."</tt>) in the sub-directory are filtered out and they will never appear in the read items. When all directory items have been read and no item to read, a nul string is stored into the <tt>fno-&gt;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.</p>
-<p>When support of long file name (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 some reason listed below, short file name is stored to the <tt>fname[]</tt> and <tt>altname[]</tt> has a null string.</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 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-&gt;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>
+<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>
<ul>
-<li>The item has no LFN. (Not the case at exFAT volume)</li>
-<li>Setting of <a href="config.html#max_lfn"><tt>FF_MAX_LFN</tt></a> is insufficient to handle the LFN. (Not the case at <tt>FF_MAX_LFN == 255</tt>)</li>
-<li>Setting of <a href="config.html#lfn_buf"><tt>FF_LFN_BUF</tt></a> is insufficient to store the LFN.</li>
-<li>The LFN contains any character not defined in current code page. (Not the case at <tt>FF_LFN_UNICODE &gt;= 1</tt>)</li>
+<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><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>
</ul>
-<p>There is a problem on reading a directory of 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 into the <tt>fname[]</tt> 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> &gt;= 1</tt> and <tt>FF_MAX_LFN == 255</tt> to support the full feature of LFN specification.</p>
+<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>
</div>
@@ -94,7 +103,7 @@ FRESULT scan_files (
printf("%s/%s\n", path, fno.fname);
}
}
- f_closedir(&amp;dir)
+ f_closedir(&amp;dir);
}
return res;