FileCopy

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 Mobile Access
FileCopy File Synchronous Supported Supported Supported Not supported

Syntax

Web Studio Help es2fr function file filecopy.xml d120632e82 FileCopy

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:StudioProjectHST*.hst”, “C:TempHst”, 1000 )
Tag FileCopy( “C:StudioProject opert.txt”, “C:TempTuesday_Report.txt”, 500 )

FileCopy