Description

Copies an operating system file to another operating system file.

Syntax

result = CopyOSFile (srcfile, destfile, overwriteflag)

Parameters

The CopyOSFile function has the following parameters.

ParameterDescription
srcfileSpecifies an operating system file or list of files. The file name includes the operating system drive and path.
destfileSpecifies the name of the destination table.
overwriteflag

Determines whether or not to overwrite existing destfile.

TValueTDescription
0Do not overwrite (default).
1Overwrite file, unconditionally
resultA Boolean value. If true then the copy was successful. If false the copy encountered an error.

Note: While result will contain a return value the safest method to ensure proper processing occurred, use Get_Status() to check for errors in copying the files.

See also

Utility("COPYFILE")

Example

declare function CopyOSFile, Get_Status
declare subroutine FsMsg
 
srcfile = 'c:\temp\demo_cust.xml'
destfile = 'c:\temp\copyosfile.xml'
overwriteflag = 0
 
result = CopyOSFile(srcfile, destfile, overwriteflag)
status = Get_Status(errCodes)
if status then
   FsMsg(errCodes)
end
  • No labels