Skip to content

FileManager.renameFile

Kerri Shotts edited this page Oct 26, 2013 · 1 revision

(part of FileManager)

Parameters:

  • filename - an absolute or relative path to the file
  • newName - the new name (optional)

Returns: Promise, resolving to the new file

ASYNCHRONOUS

Renames the file to the new name. It's a bit naive, since it uses the current working directory as the parent directory, so if the file is not in the current working directory, it's liable to be moved there.

Usage

aFileManager.renameFile ( "fileA.txt", "fileB.txt" )
            .then ( ... )
            .catch ( function ( e ) { console.log ( e ); }
            .done ();
Clone this wiki locally