Filesystem-Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Filesystem-Commands >

Filesystem-Commands

MDF. - Make-Directory-File

Previous Top Next


MiniRobotLanguage (MRL)

 

MDF. Command

Make Directory File

 

 

Intention

 

This command can be used to create a file and a directory in one strike.

It will create an directory with all folders and then create the file.

 

If the file/folder already exists or if the folder can't be created you will get an error in a return variable, if given.

 

You can synchronize programs using a file. This command will create a file instantly and tell you if it was successful. Usage is simple:

 

VAR.§§DIR=?desktop\MydirA\MyDirB\MyDirC\Myfile.txt

' Will create the directory and the file.

' If the directory exists, only the file is created.

MDF.§§DIB

 

 

 

Syntax

 

 

MDF.P1[|P2][|P3]

 

 

Parameter Explanation

 

P1 - Filepath

 

P2 - (optional) Filedata, Data to store in the file.

    If Parameter 2 is omitted, an empty file is created.

 

P3 - (optional) Variable, Result of Operation (Error-Code)

 

 

 

 

Example

 

'*************************************

' MFD - DEMO

'*************************************

'DBM.2

 

VAR.§§DIR=?desktop\MydirA\MyDirB\MyDirC\Myfile.txt

VAR.§§DIB=?desktop\MydirA\MyDirB\MyDirC\Empty.txt

VAR.$$TXT=This text will be in that file$crlf$Line 2.

MDF.§§DIR|$$TXT|$$ERG

MDF.§§DIB

MBX.Success: $$ERG

END.

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    ATF - Append-to-File

    CFF. - Copy-From-File

    CTF - Copy-To-File

    COP. - Copy File

    SHF. - Shell-File-Operation

    MKD. - Make-Directory

    GLC. - Get-Line-Count

    IEF. / NEF. - If - exist - File

    LFF - Line-From-File

    WFF. - Wait-For-File

    DEL. - Delete File

    REN. - Rename File/Dir