create directory commands

Prev Next

Function Names

mkdir, md

Description

This function creates a new directory with the name provided. Both mkdir and md do exactly the same.

These functions are ideally suited for interactive use.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
string direcory name

Specify the directory name. If the directory shall be created in a location other than the working directory, then specify the full path. Intermediate sub-directories between existing directories and the location of the new directory will be created automatically, too, so you don't need to call this function for "dir1"; "dir1/dir2", "dir1/dir2/dir3" ... etc.

Exceptions

Specified working directory already exist or is not accessible, will be printed out as a short message

Examples

               include( Short Commands Library );
               md( My Folder 1 ); // Create 5 directories
               mkdir( My Folder 2 ); // Create 5 directories
               if (system info[operating system]=Windows)
                   system( 'dir /W "My Folder*"' ); // Show directory listing
               else:
                   system( "ls 'My Folder'* " ); // Show directory listing
               rmdir( My Folder 1 );
               rd( My Folder 2 );

Output

 Datenträger in Laufwerk C: ist Windows
Volumeseriennummer: 96E3-BA76

Verzeichnis von C:\Users\zur-b\OneDrive\Documents\Programme\Beyond4P\B4P_Docu_Maker

[My Folder 1] [My Folder 2]
               0 Datei(en),              0 Bytes
               2 Verzeichnis(se), 58’270’892’032 Bytes frei
Try it yourself: Open LIB_Function_mkdir.b4p in B4P_Examples.zip. Decompress before use.

See also

directory create