X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/0f3b947bda5f34662a611272b9f12199e0da9aca..976db69ffa80c4d499e53f6f22c26d784fdac0a1:/fatfs/documents/doc/stat.html 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 (
path
Pointer to the null-terminated string that specifies the object to get its information. The object must not be the root direcotry.
fno
-
Pointer to the blank FILINFO structure to store the information of the object. Set null pointer if it is not needed.
+
Pointer to the blank FILINFO structure to store the information of the object. Set null pointer if this information is not needed.
@@ -54,7 +54,8 @@ FRESULT f_stat (

Description

-

The f_stat function checks the existence of a file or sub-directory. If not exist, the function returns with FR_NO_FILE. If exist, the function returns with FR_OK 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 FILINFO structure and f_readdir function.

+

The f_stat function checks the existence of a file or sub-directory in the directory. If it is not exist, the function returns with FR_NO_FILE. If it is exist, the function returns with FR_OK 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 FILINFO structure and f_readdir function.

+

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.

@@ -69,16 +70,17 @@ FRESULT f_stat (
     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", &fno);
+    fr = f_stat(fname, &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 >> 9) + 1980, fno.fdate >> 5 & 15, fno.fdate & 31,
                fno.ftime >> 11, fno.ftime >> 5 & 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: