Click or drag to resize

DirMake Function

Create a directory.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
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.  For a complete list of DOS error codes and accompanying descriptions, see Appendix A.
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#
DirMake("c:\vo\one")                        // Create top-most one
siResult := DirMake("c:\vo\one\two")
IF siResult != 0
        ? DOSErrString(siResult)        // check DOS error ENDIF
See Also