CopyFile
0 | Simple copying of a file. |
1 | Copying fails if the file already exists. |
2 | First creates a template for the file, before it is used. This procedure is recommended in a situation with poor connections, in order to prevent copying of incomplete files. |
4 | Creates a backup of the old file. |
0 | Simple copying of a file. |
1 | Copying fails if the file already exists. |
2 | First creates a template for the file, before it is used. This procedure is recommended in a situation with poor connections, in order to prevent copying of incomplete files. |
4 | Creates a backup of the old file. |
This script function can be used for executing two different copy processes.
- 1. Copy files from the host PC to the target device.
- 2. Copy files locally on the target device from one location to another.
1. Copy from the host PC to the target device:
Copyfile(<$NetShare$>\<%Targetfolder%>\<%Filename%>,<%Targetfolder%>,<%CopyFlag%>);
Parameter | Description |
---|---|
<$NetShare$> | Name of the activation in which the folder structure can be found. |
<%Targetfolder%> | Specifies the name of the directories to which the file is to be copied on the device. Example value: |
<%Filename%> | Specifies the name for the file to be copied on the device. Example value: |
<%Targetfolder%> | Specifies the path of the folder structure to be copied. (Usually the same name as the first "Targetfolder" parameter. Therefore the same parameter name) |
<%CopyFlag%> | Options for the copy function. |
Example:
Copyfile("\\hostPC\TcManagementSrv_TEST\Hard Disk\TestFile1.txt","\Hard Disk",1);
2. Copying locally on the target device:
Change the parameter names as described here:
Copyfile(<%LocalShare%>\<%Sourcefolder%>\<%Filename%>,<%Targetfolder%>,<%CopyFlag%>);
Parameter | Description |
---|---|
<%LocalShare%> | Local path under which the folder structure can be found. |
<%Sourcefolder%> | Specifies the path of the folder structure to be copied. Example value:
"\TestFolder" |
<%Filename%> | Specifies the name for the file to be copied on the device. Example value: |
<%Targetfolder%> | Specifies the name of the directories to which the file is to be copied on the device. Example value: |
<%CopyFlag%> | Options for the copy function. |
Example:
The following example copies the file "TestFile1.txt" from folder "\Hard Disk\system" to folder "\Hard Disk\TestFolder":
Copyfile("\Hard Disk\System\TestFile1.txt","\Hard Disk\TestFolder",1);