New in package 167
Syntax
file.copyTo( directory[, options ] );
Description
Copies the file into the specified destination directory, returns new FileSystem.File object.
Parameters
Parameter | Type | Description |
---|---|---|
directory | String or Directory | Target directory. |
options.name | String | New file name; by default file [name] is used. |
Other FileSystem.file() options can also be used.
Example
Copy a file making sure the file name is unique:
Transcode a text file: