CreateDirectory()

Purpose
The CreateDirectory function creates a new directory. If the underlying file system supports security on files and directories, the function applies a specified security descriptor to the new directory. Note that CreateDirectory does not have a template parameter, while CreateDirectoryEx does.
 
Library Transcribed by Date of page Updated on
Kernel32.dll, Kernel.dll J.Paris 18.10.00  
 
Restrictions on use
none
 
Declare 32-bit
declare function CreateDirectory32 lib "Kernel32.dll" alias "CreateDirectoryA"
    (
       byval sPath as string,
       tSecurity as SECURITY_ATTRIBUTES
    ) as integer
 
Declare 16-bit
declare function CreateDirectory16 lib "Kernel.dll" alias "CreateDirectory"
    (
       byval szDir as string,
       tSecurity as SECURITY_ATTRIBUTES
    ) as integer
 
Required Type definition
SECURITY_ATTRIBUTES
 
Parameters
sPath (szDIR) Points to a null-terminated string that specifies the path of the directory to be created.
There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the CreateDirectory function parses paths.
 
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
 
Example
Bill Thoen's Create/Remove directory
 
Comments
 
See also
CreateDirectoryEx()
CreateFile()
RemoveDirectory()