Copies the file(s) configured in the
strSourceFile parameter to
the path/file configured in the strTargetFile parameter.
Function |
Group |
Execution |
Windows |
Embedded |
Thin Client |
FileCopy
|
File |
Synchronous |
Supported |
Supported |
Supported |
Syntax
FileCopy(strSourceFile,strTargetFile { | ,optNumTimeOut } )
- strSourceFile
- The file path and name the file(s) to be copied.
Tip: This
function supports wildcards (* and
?).
- strTargetFile
- The file path where the file(s) are to be
copied.
- optNumTimeOut
- Numerical tag containing an integer to set the
timeout time for the operation.
If you use the optNumTimeOut parameter, the function
returns the value −1 after the specified timeout time and the scan
continues. Though the function returns a −1, it does not cancel the
copying procedure. Instead, it creates an internal process to
finish the copying procedure.
Returned value
−1 |
Timeout
time expired. |
0 |
Failed to
copy file(s). |
1 |
File(s)
copied successfully. |
Notes
CAUTION:
This function executes synchronously,
which means that the project pauses while it waits for the function
to return. As such, if the function is called to copy files from or
to another volume across a slow network, then the project could be
paused for long time.
Examples
Tag Name |
Expression |
Tag |
FileCopy( "C:\Studio\Project\HST\*.hst",
"C:\Temp\Hst\", 1000 )
|
Tag |
FileCopy( "C:\Studio\Project opert.txt",
"C:\Temp\Tuesday_Report.txt", 500 )
|