ssCore.FileSys.copyFile

Copies an existing file to a new location.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

from - A fully qualified path to the an existing file. This parameter supports monikers.

to - A fully qualified path to the new file. This parameter supports monikers.

failIfExists - [Optional] - Force the file copy to fail if the 'To' file exists before the copy. Valid values include: true,false. Default value is false.


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.FileSys.copyFile( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.FileSys.copyFile( paramsObject );


Notes:

Both from and to must be fully qualified file names, you can't specify a file for from and a folder for to as you do with the DOS copy command.

You don't have to use the same file name at the end of the path for the from and to files. Using different names means you can rename files as part of the copy operation.

                

Examples:

ssCore.FileSys.copyFile({from:"startdir://file.txt", to:"startdir://archive\\file.txt"});