System.IOUtils.TDirectory.Delete
Delphi
class procedure Delete(const Path: string); overload; inline; static;
class procedure Delete(const Path: string; const Recursive: Boolean); overload; static;
C++
static void __fastcall Delete(const System::UnicodeString Path)/* overload */;
static void __fastcall Delete(const System::UnicodeString Path, const bool Recursive)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.IOUtils.pas System.IOUtils.hpp |
System.IOUtils | TDirectory |
Description
Deletes a directory at the given path.
Use Delete to delete a directory at the given path. The following table lists the parameters this method expects:
Name | Meaning |
---|---|
Path |
Path of the directory being deleted. |
Recursive |
The deletion is recursive. If this parameter is false, nonempty directories will not be deleted. |
The second version of Delete does not expect a Recursive parameter; it is considered to be false. This means that the second version of Delete will fail on nonempty directories. Neither version of Delete reports whether the deletion operation succeeded.
Note: Delete raises an exception if the given Path is invalid or contains invalid characters.
See Also
Code Examples