xHarbour Reference Documentation > Function Reference |
Removes a directory.
DirRemove( <cDirectory> ) --> nOSError
The function returns a numeric value representing the operating system error code (DOS error). A value of 0 indicates a successful operation.
The function attempts to remove the directory specified with <cDirectory>. If this operation fails, the function returns the OS error code indicating the reason for failure. See the FError() function for a description of OS errors.
See also: | CurDir(), DirChange(), Directory(), IsDisk(), DiskChange(), DiskName(), MakeDir(), FError() |
Category: | Directory functions , File functions |
Source: | rtl\dirdrive.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example creates and deletes directories and outlines possible // error conditions. PROCEDURE Main ? CurDrive()+":\"+CurDir() // result: C:\xhb\tests ? MakeDir( "C:\Temp\Data" ) // result: 0 ? DirRemove( "Data" ) // result: 2 ? DirRemove( "C:\Temp\data" ) // result: 0 ? DirRemove( "C:\temp" ) // result: 145 RETURN
http://www.xHarbour.com