Copies a file from the source location specified by a URL or a file pathname to the specified destination directory.
Parameters:
srcURI
Specifies the source file location, which may be either an absolute URL or an absolute file pathname on the local system.In case of a file pathname, the allowed name-separator character may be
'/'
or'\'
.When this parameter is
null
or empty string or the specified source file does not exist, the function does nothing and returns an empty string.
dstDir
The pathname of the destination directory.If the provided pathname is not an absolute one, it is resolved against the current system directory. The allowed name-separator character may be
'/'
or'\'
.When this parameter is
null
or empty string, the function does nothing and returns empty string.If the destination directory does not exist, it will be created including any necessary but nonexistent parent directories.
If the destination directory exists and already contains an equally named file, it will be overwritten with the copied one.
Returns:
The pathname of the result file or empty string in case of any error.
The name-separator character will be always: '/'
Notice:
The generator tracks each call of the copyFile()
function so that for each set of parameters:
the actual file copying is executed only once. This helps to avoid multiple copying of the same file, particularly when the{ srcURI; dstDir
(as absolute pathname)}
copyFile()
function is called from an expression that may be
repeatedly executed a number of times.
For a given set of parameters, the function always returns the same result during both the first and the subsequent "idle" calls.
See Also:
copyFiles()