FSStat

Syntax

#include <cafe/fs.h>

/* File/Dir status */
typedef struct
{
    FSFlag          flag;

    FSMode          permission;
    FSUserId        owner_id;
    FSGroupId       group_id;

    FSSize          size;
    FSSize          alloc_size;
    FSBSize         quota_size;

    u32             ent_id;

    FSTime          ctime;
    FSTime          mtime;

    u8              attributes[FS_STAT_ATTRIBUTES_SIZE];

} PACKED_STRUCT_ATTRIBUTE FSStat;

Elements

flag Flag bit field indicating properties of file/directory. It includes:
FS_STAT_FLAG_IS_DIRECTORY The entry is a directory.
FS_STAT_FLAG_IS_QUOTA The entry is a quota.
FS_STAT_FLAG_SPRT_QUOTA_SIZE quota_size field is valid.
FS_STAT_FLAG_SPRT_ENTID ent_id field is valid.
FS_STAT_FLAG_SPRT_CTIME ctime field is valid.
FS_STAT_FLAG_SPRT_MTIME mtime field is valid.
FS_STAT_FLAG_SPRT_ATTRIBUTES attributes field is valid.
FS_STAT_FLAG_SPRT_FILE_ALLOC_SIZE alloc_size field is valid.
FS_STAT_FLAG_SPRT_DIR_SIZE size field is valid for directory.
FS_STAT_FLAG_IS_UNSUPPORTED_CHAR Entry name contains unsupported character.
permission Access permissions.
owner_id Owner title Id.
group_id Owner group Id.
size File size in bytes. Valid when the entry is file. When the entry is a directory and FS_STAT_FLAG_SPRT_DIR_SIZE is set in flag, size indicates total size of the directory.
alloc_size Allocated file size in bytes. Valid when entry is file and FS_STAT_FLAG_SPRT_FILE_ALLOC_SIZE in flag is set.
quota_size Total size of quota to which the entry belongs. Valid when FS_STAT_FLAG_SPRT_QUOTA_SIZE in flag is set. Note that real occupied size by the quota may be larger than quota_size.
ent_id Entry ID. Valid when FS_STAT_FLAG_SPRT_ENTID in flag is set.
ctime Created time. Valid when FS_STAT_FLAG_SPRT_CTIME in flag is set. Note that the time may get changed by the system out of application's control. Application should not assume that the value will not change after the application created the entry.
mtime Last modified time. Valid when FS_STAT_FLAG_SPRT_MTIME in flag is set. Note that the time may get changed by the system out of application's control. Application should not assume that the value will not change after the last time app modified the entry.
attributes FS-specific attribute field. Valid when FS_STAT_FLAG_SPRT_ATTRIBUTES in flag is set.

Description

Status information of file/directory obtained by FSReadDir, FSGetStatFile, or FSGetStat.

FSTime is an unsigned 64-bit value which indicates elapsed time in microseconds from 0:00 AM Jan. 1, 1980.

See Also

File/Directory operations
FSGetStatFile
FSReadDir
FSGetStat

Revision History

2014/06/04 Added a note that ctime and mtime may get changed by the system out of application's control.
2014/04/18 Added a note about quota_size.
2013/12/05 Added a note about how to get FSStat.
2013/05/08 Automated cleanup pass.
2012/07/20 Readability cleanup.
2012/02/20 Initial version.


CONFIDENTIAL