void FSEntry_Create (CPU_CHAR *name_full,
FS_FLAGS entry_type,
CPU_BOOLEAN excl,
FS_ERR *p_err);
File | Called from | Code enabled by |
| Application;
| not |
Create a file or directory.
See also fs_mkdir()
.
Arguments
name_full
Name of the entry. See section 4-3 “μC/FS File and Directory Names and Paths”.
entry_type
Indicates whether the new entry shall be a directory or a file (see Note #1) :
FS_ENTRY_TYPE_DIR
, if the entry shall be a directory.
FS_ENTRY_TYPE_FILE
, if the entry shall be a file.
excl
Indicates whether the creation of the new entry shall be exclusive (see Notes):
DEF_YES
, if the entry shall be created only if p_name_full
does not exist.
DEF_NO
, if the entry shall be created even if p_name_full
does exist.
p_err
Pointer to variable that will the receive return error code from this function:
FS_ERR_NONE
Entry created successfully.
FS_ERR_NAME_NULL
Argument name_full
passed a NULL pointer.
FS_ERR_NAME_INVALID
Entry name specified invalid OR volume could not be found.
FS_ERR_NAME_PATH_TOO_LONG
Entry name specified too long.
FS_ERR_VOL_NOT_OPEN
Volume was not open.
FS_ERR_VOL_NOT_MOUNTED
Volume was not mounted.
FS_ERR_BUF_NONE_AVAIL
Buffer not available.
FS_ERR_DEV
Device access error. Or entry error.
Returned Value
None.
Notes/Warnings
- If the entry exists and is a file, entry_type is
FS_ENTRY_TYPE_FILE
and excl isDEF_NO
, then the existing entry will be truncated. If the entry exists and is a directory and entry_type isFS_ENTRY_TYPE_DIR
, then no change will be made to the file system. - If the entry exists and is a directory, dir is
DEF_NO
and excl isDEF_NO
, then no change will be made to the file system. Similarly, if the entry exists and is a file, dir isDEF_YES
and excl isDEF_NO
, then no change will be made to the file system. - The root directory may not be created.