Getting Information About a File

Detailed information about an open file, such as size and date/time stamps, can be obtained using the FSFile_Query() function (see Listing - Example FSFile_Query() usage).

Listing - Example FSFile_Query() usage
FS_ENTRY_INFO info;
FSFile_Query(p_file,  /* file pointer               */
            &info,    /* pointer to info structure  */
            &err);    /* return error               */


Attrib
contains the file attributes (see File and Directory Attributes).The FS_ENTRY_INFO structure has the following members:

  • Size is the size of the file, in octets.
  • DateTimeCreate is the creation timestamp of the file.
  • DateAccess is the access timestamp (date only) of the file.
  • DateTimeWr is the last write (or modification) timestamp of the file.
  • BlkCnt is the number of blocks allocated to the file. For a FAT file system, this is the number of clusters occupied by the file data.
  • BlkSize is the size of each block allocated in octets. For a FAT file system, this is the size of a cluster.

DateTimeCreate, DateAccess and DateTimeWr are structures of type CLK_TS_SEC.