<< Click to Display Table of Contents >> Navigation: 3. Script Language > Filesystem-Commands > Filesystem-Commands |
MiniRobotLanguage (MRL)
DCP. Command
Copy Directory
Intention
This command is used to copy complete folders with all files and sub-folders.
The command puts a zero (0) = "Operation failed or was aborted" or a one (1) = "operation successful" on the stack to flag if the operation was successful or not.
It will also set the TimeOut-Flag in case of an error.
Usage is as easy as:
DCP.source|dest
The Command needs a "\" at the end of each Path to make sure that its a Pathname, not a filename..
DCP.c:\folder\|d:\folderX\
will result in a new folder:
d:\folderX\folder\
WARNING:
The command in its default-settings does not ask for any confirmation when overwriting files, even protected files.
Wrongly used on existing files, It can do serious damages to your files and data.
Therefore use it with care and on your own risk!
To debug your scripts safely, you can use:
OPT.SAFEFILE|1
this will bring up such a Messagebox for destructive File-Operations like DEL., RMD. REN. and DCP.
You can choose between
- "Yes" - this will start the requested file-operation
- "No" - this will prevent the requested file-operation and set the Timeout-Flag
- "Cancel" - this will prevent the requested file-operation and set the Timeout-Flag and end the script.
Syntax
DCP.P1|P2[|P3]
Parameter Explanation
P1 - Variable with source-folder, ending with a "\"
Example: F:\folder\
P2 - Variable with destination-folder, ending with a "\"
Example: X:\folder\
P3 - (optional) can only be "a". In case P3 is given, then
DirCopy will continue to copy even in case of copy-errors.
It will place the path of files that can not be copied on TOS.
In case "a" is given, the TIO-Flag may not be accurate (will not reflect an error).
Look on the TOS instead.
The result of the Operation (0/1) can be found on the TOS.
Also the Timeout-Flag is been set if the operation has failed.
Example
'*****************************************************
' EXAMPLE: DCP.
'*****************************************************
§§BAS=F:\Testing-Suite\
§§TPA=C:\
§§TPB=§§TPATestdirX\
§§STA=190
DCP.§§TPB|§§BAS
JIT.ero
§§STA=192
NEF.§§PAE
JIT.ero
EIF.
ENR.
:ero
MBX.Error §§STA happened!
END.
Remarks
Wildcards are not supported.
The Timeout will not be applied if directories shall be renamed.
To show that something is a folder, suffixe it with a "\".
' This is a file
§§FIA=C:\myname
' This is a folder
§§FIA=C:\myname\
Limitations:
-
See also:
• IEF. / NEF. - If - exist - File