Click or drag to resize

DirMake Function

X#
Create a directory.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION DirMake(
	pszNewDir AS STRING
) AS LONG
Request Example View Source

Parameters

pszNewDir
Type: String
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