1.2.7.4.35 SYS_FS_FileDirectoryModeSet Function

1.2.7.4.35 C

SYS_FS_RESULT SYS_FS_FileDirectoryModeSet
(
    const char* path,
    SYS_FS_FILE_DIR_ATTR attr,
    SYS_FS_FILE_DIR_ATTR mask
);

1.2.7.4.35 Summary

Sets the mode for the file or directory.

1.2.7.4.35 Description

This function sets the mode for a file or directory from the specified list of attributes.

1.2.7.4.35 Precondition

The file or directory for which the mode is to be set must exist.

1.2.7.4.35 Parameters

ParametersDescription
pathPath for the file/directory, for which the mode is to be set.
attrAttribute flags to be set in one or more combination of the type SYS_FS_FILE_DIR_ATTR. The specified flags are set and others are cleared.
maskAttribute mask of type SYS_FS_FILE_DIR_ATTR that specifies which attribute is changed. The specified attributes are set or cleared.

1.2.7.4.35 Returns

SYS_FS_RES_SUCCESS - Mode set operation was successful.

SYS_FS_RES_FAILURE - Mode set operation was unsuccessful. The reason for the failure can be retrieved with SYS_FS_Error.

1.2.7.4.35 Example

// Set read-only flag, clear archive flag and others are retained.
SYS_FS_FileDirectoryModeSet("file.txt", SYS_FS_ATTR_RDO, SYS_FS_ATTR_RDO | SYS_FS_ATTR_ARC);

1.2.7.4.35 Remarks

None.