FileSystemManager.rename(Object object)
Renames a file, and moves it from oldPath to newPath.
Parameters
Object object
Attribute | Type | Default | Required | Description |
oldPath | string | | Yes | The old path to the file, which can be a normal file or directory |
newPath | string | | Yes | The new path to the file |
success | function | | No | The callback function for a successful API call |
fail | function | | No | Callback function for failed API call |
complete | function | | No | Callback function used when API call completed (always executed whether call succeeds or fails) |
object.fail callback function
Parameters
Object res
Property | Type | Description |
errMsg | string | Error message |
Valid values of res.errMsg
Value | Description | Minimum Version |
fail permission denied, rename ${oldPath} -> ${newPath} | No write permission on the specified source file or target file | |
fail no such file or directory, rename ${oldPath} -> ${newPath} | The source file does not exist, or the upper-layer directory of the target file path does not exist | |