storage_common_rename

Function storage_common_rename 

Source
pub unsafe extern "C" fn storage_common_rename(
    storage: *mut Storage,
    old_path: *const c_char,
    new_path: *const c_char,
) -> FS_Error
Expand description

Rename a file or a directory.

The file or the directory must NOT be open. Will overwrite the destination file if it already exists.

Renaming a regular file to itself does nothing and always succeeds. Renaming a directory to itself or to a subdirectory of itself always fails.

§Arguments

  • storage - pointer to a storage API instance.
  • old_path - pointer to a zero-terminated string containing the source path.
  • new_path - pointer to a zero-terminated string containing the destination path.

§Returns

FSE_OK if the file or directory has been successfully renamed, any other error code on failure.