Top
Top
LibraryEASYProcess Reference Manual 5ProcessesServicesFileSystemWorkshopCopyFile

CopyFile Overview

The CopyFile service allows you to copy a file from one directory to another. CopyFile will not create the directory if target directory does not exist.


CopyFile Use Examples
Workshop:FileSystemWorkshop
Service:CopyFile
Inputs
FromFileThe full path of the source file.

ToFileThe full path of the target file.

OverrideThere are two valid values. Yes - If there is already a file in the ToFile path, the file will be overwritten by the FromFile. No - If there is already a file in the ToFile path, the file will not be overwritten, and the service will end in error.

Outputs
CopiedReturns True/False depending on whether the file was copied successfully.

CopyFile Use Example

Basic CopyFile Use

This is an example that we first check if source file exists. If so, copy that file to target file.

Service returns True and you can see the TextAttach_Copy.txt is created and it has the text as source file.

If the target file already exists and the Override field is set to No, like the screenshot above, EASYProcess will throw the following error.

If the source file doesn’t exists, CopyFile throws an exception.


Powered by EASYProcess (© 2019 K-Rise Systems, Inc).