Remove a directory.
XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax View Source
pszDirName AS PSZ
) AS LONG
public static int DirRemove(
- Type: Psz
The name of the directory to erase, including an optional drive. If you do not specify a drive, the Windows default is used.
0 if successful; -1 if there is an argument error; otherwise, the DOS error code. For a complete list of DOS error codes and accompanying descriptions, see Appendix A.
DirRemove() removes a specified directory. You must have sufficient rights to delete a directory. A directory must be empty in order to be deleted. So, to delete a directory that contains subdirectories, you must first delete the subdirectories (see example below).
This example uses DirRemove() to delete a subdirectory named C:\VO\ONE, which only contains an empty subdirectory named C:\VO\ONE\TWO:
DirRemove("c:\vo\one\two") // First delete lowest dir
siResult := DirRemove("c:\vo\one")
// Then delete higher dir
? DOSErrString(siResult) // check DOS error if any