FSEntry_Rename()
void FSEntry_Rename (CPU_CHAR *name_full_old, CPU_CHAR *name_full_new, CPU_BOOLEAN excl, FS_ERR *p_err);
File | Called from | Code enabled by |
---|---|---|
| Application; | not |
Rename a file or directory.
See also fs_rename()
.
Arguments
name_full_old
Old path of the entry. See the sub-topic "µC/FS File and Directory Names and Paths" in the topic Useful Information.
name_full_new
New path of the entry.
excl
Indicates whether the creation of the new entry shall be exclusive (see Note #1):
DEF_YES
, if the entry shall be renamed only if name_full_new
does not exist.
DEF_NO
, if the entry shall be renamed even if name_full_new
does exist.
p_err
Pointer to variable that will the receive return error code from this function:
FS_ERR_NONE
File copied successfully.
FS_ERR_NAME_NULL
Argument name_full_old
or name_full_new
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.
Returned Value
None.
Notes/Warnings
- If
name_full_old
andname_full_new
specify entries on different volumes, thenname_full_old
must specify a file. Ifname_full_old
specifies a directory, an error will be returned. - If
name_full_old
andname_full_new
specify the same entry, the volume will not be modified and no error will be returned. - If
name_full_old
specifies a file:name_full_new
must not specify a directory;- if excl is
DEF_NO
andname_full_new
is a file, it will be removed.
- If
name_full_old
specifies a directory:name_full_new
must not specify a file- if excl is
DEF_NO
andname_full_new
is a directory,name_full_new
must be empty; if so, it will be removed.
- If excl is
DEF_NO
,name_full_new
must not exist. - The root directory may not be renamed.