Click or drag to resize

DirMake Function

X#
Create a directory.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION DirMake(
	pszNewDir AS PSZ
) AS LONG
Request Example View Source

Parameters

pszNewDir
Type: Psz
The name of the directory to create, 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
DirMake() creates a specified directory. You must have sufficient rights to create a directory.
To create nested subdirectories, you must create each subdirectory separately, starting from the top-level directory that you want to create (see example below.)
Examples
This example assumes that C:\VO exists and uses DirMake() twice to create a nested subdirectory under it:
X#
1DirMake("c:\vo\one")            // Create top-most one
2siResult := DirMake("c:\vo\one\two")
3IF siResult != 0
4    ? DOSErrString(siResult)    // check DOS error ENDIF
See Also