Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

void   FSEntry_Create (CPU_CHAR     *name_full,
                       FS_FLAGS      entry_type,
                       CPU_BOOLEAN   excl,
                       FS_ERR       *p_err);

File

Called from

Code enabled by

fs_entry.c

Application;
fs_mkdir()

not FS_CFG_RD_ONLY_EN

Create a file or directory.

See also fs_mkdir().

Arguments

name_full

Name of the entry. See the sub-topic "µC/FS File and Directory Names and Paths" in the topic Useful Information.

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 is DEF_NO, then the existing entry will be truncated. If the entry exists and is a directory and entry_type is FS_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 is DEF_NO, then no change will be made to the file system. Similarly, if the entry exists and is a file, dir is DEF_YES and excl is DEF_NO, then no change will be made to the file system.
  • The root directory may not be created.
  • No labels