]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - fatfs/doc/en/stat.html
Import fatfs R0.12b
[z180-stamp.git] / fatfs / doc / en / stat.html
index db53c5d54b0b82a756416e48ac58adb79c9ce5d9..2924660ec475335f35df2cf7b32851f9536eacb8 100644 (file)
@@ -54,8 +54,7 @@ FRESULT f_stat (
 \r
 <div class="para desc">\r
 <h4>Description</h4>\r
-<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>\r
-<p>When LFN feature is enabled, <tt>lfname</tt> in the file information structure must be NULLed prior to use it.</p>\r
+<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>\r
 </div>\r
 \r
 \r
@@ -74,23 +73,20 @@ FRESULT f_stat (
 \r
     printf("Test for 'file.txt'...\n");\r
 \r
-<span class="k">#if</span> _USE_LFN\r
-    fno.lfname = 0;\r
-<span class="k">#endif</span>\r
     fr = f_stat("file.txt", &amp;fno);\r
     switch (fr) {\r
 \r
     case FR_OK:\r
-        printf("Size: %u\n", fno.fsize);\r
+        printf("Size: %lu\n", fno.fsize);\r
         printf("Timestamp: %u/%02u/%02u, %02u:%02u\n",\r
                (fno.fdate &gt;&gt; 9) + 1980, fno.fdate &gt;&gt; 5 &amp; 15, fno.fdate &amp; 31,\r
                fno.ftime &gt;&gt; 11, fno.ftime &gt;&gt; 5 &amp; 63);\r
         printf("Attributes: %c%c%c%c%c\n",\r
-               (fno.fattrib & AM_DIR) ? 'D' : '-',\r
-               (fno.fattrib & AM_RDO) ? 'R' : '-',\r
-               (fno.fattrib & AM_HID) ? 'H' : '-',\r
-               (fno.fattrib & AM_SYS) ? 'S' : '-',\r
-               (fno.fattrib & AM_ARC) ? 'A' : '-');\r
+               (fno.fattrib &amp; AM_DIR) ? 'D' : '-',\r
+               (fno.fattrib &amp; AM_RDO) ? 'R' : '-',\r
+               (fno.fattrib &amp; AM_HID) ? 'H' : '-',\r
+               (fno.fattrib &amp; AM_SYS) ? 'S' : '-',\r
+               (fno.fattrib &amp; AM_ARC) ? 'A' : '-');\r
         break;\r
 \r
     case FR_NO_FILE:\r