DirRemove Function | |
Remove a directory.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION DirRemove(
pszDirName AS STRING
) AS LONG
public static int DirRemove(
string pszDirName
)
Request Example
View SourceParameters
- pszDirName
- Type: String
The name of the directory to erase, including an optional drive.
If you do not specify a drive, the Windows default is used.
Return Value
Type:
Long
0 if successful; -1 if there is an argument error; otherwise, the DOS error code.
Remarks
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).
Examples
This example uses DirRemove() to delete a subdirectory named C:\VO\ONE, which only contains an empty subdirectory named C:\VO\ONE\TWO:
1DirRemove("c:\vo\one\two")
2siResult := DirRemove("c:\vo\one")
3
4? DOSErrString(siResult)
See Also