Click or drag to resize

DirMake Function

Create a directory.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.4a
Syntax
 FUNCTION DirMake(
	pszNewDir AS STRING
) AS LONG
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: Int32
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