Table of Contents

CopyOSFile function

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.
overwriteflagDetermines whether or not to overwrite existing destfile.

Value Description
0 - Do not overwrite (default).
1 - Overwrite 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