Copy File
Copy File
Section titled “Copy File”Type: copy-file · Package: Filesystem Activities v1.0.0 · Output: string
Copies a file from a source path to a destination path, leaving the original in place. Use it to back up a file before modifying it, duplicating a template, or distributing a document to multiple folders.
How it works
Section titled “How it works”Copy the file from source to destination. By default does not overwrite: if the destination already exists, the activity fails (unless you put overwrite = true).
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
source | expression | Source file path. |
destination | expression | Path of the destination file. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
overwrite | boolean | Replace if the destination already exists. By default false. |
Output
Section titled “Output”Returns the destination path of the copied file, in case you want to capture it into an output variable.
Example
Section titled “Example”Back up a file before processing:
Copy File source = = "C:/datos/maestro.xlsx" destination = = "C:/backups/maestro_" + today().ToString("yyyyMMdd") + ".xlsx" overwrite = trueRelated activities
Section titled “Related activities”- Move File — move instead of copy (does not leave the original).
- Create Directory — create the destination folder.
- File Exists — comprobar antes de copiar.