Salesforce

How Do I Copy a Disk File? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Copy a Disk File? (Magic xpa 3.x)

Sometimes you may want to make a copy of a disk file. This is useful for making backup or archival copies, for instance.

It is always better to use the Magic xpa functions rather than using an exit to the operating system. Using an exit to the operating system is very dependent on the version of the operating system and how the user is set up; the Magic xpa functions are far more reliable. Also, the Magic xpa functions allow you to check return codes more easily.

FileCopy()

You can copy a file on disk using the FileCopy() function. The syntax is:

FileCopy(origin, target)

Where origin is the original file and target is what you want to copy it to. It gives a return code of true if the file was successfully copied.

Note: FileCopy() will overwrite any existing file of the same name. If you want to give the user a warning message, use the FileExist() function first.

See also

The FileExist() description in How Do I Check if a File Exists on Disk?

The Online and Rich Client Samples projects (program EL16, REL16 and REL16b)

Reference
Attachment 
Attachment