Delete(Path: String; Recursive: Boolean);
Path - a directory that should be deleted.
Recursive - a parameter that determines whether a specified directory is deleted together with subdirectories and files. True should be passed as a parameter value to delete a directory with all its content. The False value is used to delete an empty directory.
The Delete method deletes a specified directory.
If a specified directory does not exist, an exception is generated.
If False is passed as a parameter Recursive value and specified directory contains subdirectories and files, an exception is generated.
Sub UserProc(sPath: String);
Begin
If Directory.Exists(sPath) Then
Directory.Delete(sPath, True);
End If;
End Sub UserProc;
While executing this example it is checked whether directory, specified in the parameter sPath, is present in file system. If directory exists it is deleted with all its content.
See also: