summaryrefslogtreecommitdiff
path: root/fatfs/documents/doc/stat.html
diff options
context:
space:
mode:
authorLeo C.2024-06-30 09:37:28 +0200
committerLeo C.2024-06-30 09:37:28 +0200
commit5630b9308323c3f3aaa09be8fe0f3aecaa826473 (patch)
treead11998289caa623b98507393f838611317ad03e /fatfs/documents/doc/stat.html
parentdbd0d34e68c73b9d3628cc1a1bda0b883976fc8b (diff)
downloadz180-stamp-5630b9308323c3f3aaa09be8fe0f3aecaa826473.zip
Import fatfs R0.15fatfs-0.15chan-fatfs
Diffstat (limited to 'fatfs/documents/doc/stat.html')
-rw-r--r--fatfs/documents/doc/stat.html14
1 files changed, 8 insertions, 6 deletions
diff --git a/fatfs/documents/doc/stat.html b/fatfs/documents/doc/stat.html
index db63667..a4e4fc8 100644
--- a/fatfs/documents/doc/stat.html
+++ b/fatfs/documents/doc/stat.html
@@ -28,7 +28,7 @@ FRESULT f_stat (
<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>
<dt>fno</dt>
-<dd>Pointer to the blank <tt>FILINFO</tt> structure to store the information of the object. Set null pointer if it is not needed.</dd>
+<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>
</div>
@@ -54,7 +54,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. 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 and attribute, 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>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>
</div>
@@ -69,16 +70,17 @@ FRESULT f_stat (
<pre>
FRESULT fr;
FILINFO fno;
+ const char *fname = "file.txt";
- printf("Test for 'file.txt'...\n");
+ printf("Test for \"%s\"...\n", fname);
- fr = f_stat("file.txt", &amp;fno);
+ fr = <em>f_stat</em>(fname, &amp;fno);
switch (fr) {
case FR_OK:
printf("Size: %lu\n", fno.fsize);
- printf("Timestamp: %u/%02u/%02u, %02u:%02u\n",
+ 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",
@@ -90,7 +92,7 @@ FRESULT f_stat (
break;
case FR_NO_FILE:
- printf("It is not exist.\n");
+ printf("\"%s\" is not exist.\n", fname);
break;
default: