Skip to content

FileSystemManager.renameSync ​

JS
    FileSystemManager.renameSync(string oldPath, string newPath)

Rename a file

The synchronous version of FileSystemManager.rename

Parameters

  • string oldPath: Source file path; can be a regular file or a directory

  • string newPath: New file path

Parameters of the captured exception

  • string error: Returns the error message; see the table below for valid values

Valid values of error:

Error messageDescription
no such file or directoryThe source file does not exist, or the parent directory of the target file path does not exist
permission deniedNo write permission