CreateDirectory

 

Description

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

Syntax

BOOL CreateDirectory( LPCSTR lpPathName, SECURITY_ATTRIBUTES * lpSecurityAttributes )

Parameters

lpPathName
[input] Pointer 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 248 characters. This limit is related to how the CreateDirectory function parses paths.
lpSecurityAttributes
[output] Pointer to a SECURITY_ATTRIBUTES structure.The lpSecurityDescriptor member of the structure specifies a security descriptor for the new directory. If lpSecurityAttributes is NULL, the directory gets a default security descriptor. The target file system must support security on files and directories for this parameter to have an effect.

Return

TRUE the function succeeds; else false.

Examples

EX1

int    CreateDirectory_ex1()
{
    char    szDirPath[] = "c:\\TEXTRO\\"; 
    if (!CreateDirectory(szDirPath, NULL)) 
    { 
        out_str("Couldn't create new directory."); 
    }
    return 1; 
}

Remark

See Also

RemoveDirectory

header to Include

origin.h

Reference