Filesystem-Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Filesystem-Commands >

Filesystem-Commands

DCP. Directory Copy

Previous Top Next


MiniRobotLanguage (MRL)

 

DCP. Command

Copy Directory

 

NTFS-Direct

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.

 

2015-01-22 14_57_43-Safety-Warning _ SPR-Script

 

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:

 

    3.3 Specialfolders

    ATF - Append-to-File

    CFF. - Copy-From-File

    CTF - Copy-To-File

    CTI. - Copy-To-Inifile

    CFI. - Copy-From_IniFile

    GLC. - Get-Line-Count

    IEF. / NEF. - If - exist - File

    LFF - Line-From-File

    SHF. - Shell-File-Operation

    WFF. - Wait-For-File