Mstdlib-1.24.0

Functions

M_fs_error_t M_fs_info (M_fs_info_t **info, const char *path, M_uint32 flags)
 
M_fs_error_t M_fs_info_file (M_fs_info_t **info, M_fs_file_t *fd, M_uint32 flags)
 
void M_fs_info_destroy (M_fs_info_t *info) M_FREE(1)
 
const char * M_fs_info_get_user (const M_fs_info_t *info)
 
const char * M_fs_info_get_group (const M_fs_info_t *info)
 
M_fs_type_t M_fs_info_get_type (const M_fs_info_t *info)
 
M_bool M_fs_info_get_ishidden (const M_fs_info_t *info)
 
M_uint64 M_fs_info_get_size (const M_fs_info_t *info)
 
M_time_t M_fs_info_get_atime (const M_fs_info_t *info)
 
M_time_t M_fs_info_get_mtime (const M_fs_info_t *info)
 
M_time_t M_fs_info_get_ctime (const M_fs_info_t *info)
 
M_time_t M_fs_info_get_btime (const M_fs_info_t *info)
 
const M_fs_perms_tM_fs_info_get_perms (const M_fs_info_t *info)
 

Detailed Description

Function Documentation

◆ M_fs_info()

M_fs_error_t M_fs_info ( M_fs_info_t **  info,
const char *  path,
M_uint32  flags 
)

Get information about a given path.

Parameters
[out]infoAllocated info object with the info about the path. If passed as NULL then this only verifies that a path exists. However, M_fs_perms_can_access is more useful for checking for file existence.
[in]pathThe path.
[in]flagsM_fs_info_flags_t defining behavior of how and what info to read.
Returns
Result.

◆ M_fs_info_file()

M_fs_error_t M_fs_info_file ( M_fs_info_t **  info,
M_fs_file_t fd,
M_uint32  flags 
)

Get information about an open file.

Parameters
[out]infoAllocated info object with the info about the path. If passed as NULL then this only verifies that a path exists. However, the file is already open so it exists!
[in]fdThe file.
[in]flagsM_fs_info_flags_t defining behavior of how and what info to read.
Returns
Result.

◆ M_fs_info_destroy()

void M_fs_info_destroy ( M_fs_info_t info)

Destroy an info object.

Parameters
[in]infoThe info object.

◆ M_fs_info_get_user()

const char * M_fs_info_get_user ( const M_fs_info_t info)

Get the user from a path info.

Parameters
[in]infoThe info object.
Returns
The user/owner.

◆ M_fs_info_get_group()

const char * M_fs_info_get_group ( const M_fs_info_t info)

Get the group from a path info.

Parameters
[in]infoThe info object.
Returns
The group.

◆ M_fs_info_get_type()

M_fs_type_t M_fs_info_get_type ( const M_fs_info_t info)

Location type.

Parameters
[in]infoThe info object.
Returns
The path type.

◆ M_fs_info_get_ishidden()

M_bool M_fs_info_get_ishidden ( const M_fs_info_t info)

Is this a hidden file?

Parameters
[in]infoThe info object.
Returns
M_TRUE if this is a hidden file. Otherwise M_FALSE.

◆ M_fs_info_get_size()

M_uint64 M_fs_info_get_size ( const M_fs_info_t info)

The size of the path.

Parameters
[in]infoThe info object.
Returns
The size.

◆ M_fs_info_get_atime()

M_time_t M_fs_info_get_atime ( const M_fs_info_t info)

The last access time.

Parameters
[in]infoThe info object.
Returns
The time.

◆ M_fs_info_get_mtime()

M_time_t M_fs_info_get_mtime ( const M_fs_info_t info)

The last modify time.

Parameters
[in]infoThe info object.
Returns
The time.

◆ M_fs_info_get_ctime()

M_time_t M_fs_info_get_ctime ( const M_fs_info_t info)

The last status change time.

Parameters
[in]infoThe info object.
Returns
The time.

◆ M_fs_info_get_btime()

M_time_t M_fs_info_get_btime ( const M_fs_info_t info)

The file birth/creation time.

This time is not updated after append operations. In Linux terms, it's the time the inode was created.

Note that birth/creation times aren't available on all platforms - if you're on one of those platforms, this method will always return 0.

Parameters
[in]infoobject created by M_fs_info()
Returns
Time when file was created, or 0 if time couldn't be retrieved

◆ M_fs_info_get_perms()

const M_fs_perms_t * M_fs_info_get_perms ( const M_fs_info_t info)

Get the permissions associated with the path.

Parameters
[in]infoThe info object.
Returns
A perms object belonging to the info object. The perms object will be destroyed when the info object is destroyed.