The rmdir procedure

Description

The rmdir procedure removes (deletes) a directory/folder. If the directory/folder contains files then the rmdir call will fail.

Parameter

The rmdir procedure's only parameter is an expression of string type or char type that is the name of the directory/folder to remove.

Example

//*************************************************
// This program removes (i.e. erases) a directory
// First it asks for the name of the directory
// Then it calls rmdir to remove the directory
//************************************************
program rd(input, output);
var
   fn : filename;
begin
   write('Which directory do you want to delete? ');
   readln(fn);
   rmdir(fn);
end.

Portability

Operating Systems: All
Standard Pascal: No