remove directory commands

Prev Next

Function Names

rmdir, rd

Description

This function removes a directory. It will only work Both rmdir and rd 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 name of an existing and empty directory.

Exceptions

Specified working directory does not exist, is not empty 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’263’068’672 Bytes frei
Try it yourself: Open LIB_Function_rmdir.b4p in B4P_Examples.zip. Decompress before use.

See also

directory delete