Skip to content

FileManager.copyFile

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

(part of FileManager)

Parameters:

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

Returns: Promise, resolving to the new file

ASYNCHRONOUS

Copies the file at source to the target directory, with a newName, if specified. If newName is not specified, the file retains its original name.

Usage

aFileManager.copyFile ( "/path/to/file.txt", "/a/new/path", "aNewName.txt" )
            .then ( ... )
            .catch ( function ( e ) { console.log ( e ); }
            .done ();
Clone this wiki locally