Topic: DMD0384 FILECOPY - Copy File |
|
The Copy File (FILECOPY) instruction is used to make a copy of the contents of a file on one of the file systems to a second file on one of the file systems.
Note: you cannot use the FILECOPY instruction on a destination file that is currently open, and you should not use the FILECOPY instruction on a source file that is currently open.
Source File System - specifies which of the available file systems has the source file.
Source File Name - the full path (including any directories) of the file to copy from on the selected file system. This can be any text enclosed in double quotes, or any system or user-defined string.
Destination File System - specifies which of the available file systems to store the destination file.
Destination File Name - the full path (including any directories) of the file to copy to on the selected file system. This can be any text enclosed in double quotes, or any system or user-defined string.
Append To Destination File - what to d o if the destination file exists.
Delete Source File When Done - optionally delete the source file after the file is successfully copied. If the copy operation is not successful the source file will NOT be deleted.
The On Success and On Error parameters specify what action to perform when this instruction completes. You do not have to use the same type of selection for both On Success and On Error.
If the Set Bit selection is used for either On Success or On Error, the specified BIT location will be SET OFF when the instruction is first enabled and will remain OFF until the instruction completes. Once complete, the appropriate Success or Error bit location will be set ON. The specified Bit location is enabled with a SET (Latch) operation (not an OUT operation) meaning that it will remain ON even if this instruction's input logic goes OFF.
If the JMP to Stage selection is used for either On Success or On Error the target Stage must be in the same Program code-block as this instruction, you cannot specify a target Stage that exists in a different Program code-block. When the operation finishes, the target Stage will be enabled the same way as a standalone Jump to Stage (JMP) instruction would do it. The JMP to Stage option will only be selectable if this instruction is placed in a Program code-block.
On Success selects which of the following actions to perform if the operation is successful:
On Error selects which of
the following actions to perform if the operation is unsuccessful:
If either the On Success or On Error selections are set to JMP to Stage, Automatically create the SG box for any NEW stage number will be enabled which will automatically create any target stage that does not already exist.
|
|
Error CodesImproper use of any FILE instruction or any file system hardware problem will generate a warning message at runtime. When any of these warnings are generated, the On Error parameter in the instruction will be ON and the System ERR variable will contain one of the following text messages. You will also be alerted to this condition by yellow "Warning" text displayed in the Status Bar of Do-more Designer. Clicking that text will open the System Status to display the full text of the warning message.
|
|
Status Display
The red triangle in the upper left corner of the status display indicates this is a Fully Asynchronous instruction.
The gray triangle at the right end of the input leg indicates the input is edge-triggered, meaning this instruction will execute each time the input logic transitions from OFF to ON.
|
|
See Also
FILECOPY - Copy File
FILEQUERY - Query File or Folder Information
FILESEEK - Seek to Position in File
FILESYSCMD - Perform File System Command
EMAIL - Send Email (with file attachment)
|
|
Related Topics
|
|
Example
|
|