<< Click to Display Table of Contents >> Navigation: 3. Script Language > Filesystem-Commands > Filesystem-Commands |
MiniRobotLanguage (MRL)
DEL. Command
Delete File
Intention
This command is used to delete a file or more files. You can specify wildcards (e.g. ? and *). DEL. will not delete directories. Use RMD. for such tasks.
If you specify a "<>" in front of the filename, the file will be deleted to the User-trash of the current user.
' Delete to bin
DEL.<>?path\MyFile.txt
In case you use wildcards, the real, full filename and path of the file is been returned below TOS on position 2. On TOS is the success-flag.
DEL. has also a ">>" Option that will "Safe-Erase" Files. For this there are several Standards, one the most used Standards overwrites a file 35 times before deleting it.
We overwrite it 40 times, therefore we assume we are at the safe end with this option.
' This may take a while !
DEL.>>?path\MyFile.txt
Of course a safe-erase can never be combined with the recycle option.
DANGER: If you do not use the "<>" then this command will permanently delete files from your hard disk. Use with care and on your own risk.
If you want to debug your Script safely, you can use the
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
DEL.P1[|P2]
Parameter Explanation
P1 - Filename to delete.
<> - If you prefix the filename wit "<>" then the file will
be deleted to the recycle bin.
>> - Safe-Erase File. The file will be overwritten
about 40 times, with changing Bit-Patterns and Random
Characters before the file will be finally deleted.
Should be at least as Strong as needed.
Standard for other such programs is 35 times.
This algo is for files below 1.5 GB.
<< - Large File Safe-Erase. This is a slower implementation,
that uses 64 Bit and can therefore handle files of any
size.
P2 - (optional) Variable for Success-flag 1/0.
Example
'*****************************************************
' EXAMPLE 1: DEL - File
'*****************************************************
'DBM.2
VAR.§§FIL=?desktop\one.ini
DEL.§§FIL|§§RES
PRT.§§RES -> success?
END.
'*****************************************************
' EXAMPLE 1: DEL - File
'*****************************************************
'
DEL.<>?path\Kopie*.in?
ENR.
Remarks
In case you use wildcards, the real full filename and path of the file is been returned below TOS on position 2. On TOS is the success-flag.
Limitations:
-
See also:
• IEF. / NEF. - If - exist - File