Deletes an empty subdirectory.
procedure RmDir(const S: string); overload; procedure RmDir(P: PChar); overload;
RmDir(const AnsiString S); RmDir(const char * P);
System
RmDir removes the subdirectory with the path specified by S or P. If the path does not exist, is non-empty, or is the currently logged directory, an I/O error occurs.
Delphi Examples:
{ This example requires a text edit and a button. Enter the folder to remove in the text edit and click the button. The path is relative to the project folder. } procedure TForm1.Button1Click(Sender: TObject); begin {$I-} { Get directory name from TEdit control } RmDir(Edit1.Text); if IOResult <> 0 then MessageDlg('Cannot remove directory', mtWarning, [mbOk], 0, mbOk) else MessageDlg('Directory removed', mtInformation, [mbOk], 0, mbOk); end;
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|