CreateDirectory

CreateDirectory 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(
    LPCTSTR lpPathName,
    LPSECURITY_ATTRIBUTES lpSecurityAttributes
);

Parameters

lpPathName

A 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 260 characters. This limit is related to how CreateDirectory parses paths.

lpSecurityAttributes

Ignored in RTSS. A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpSecurityAttributes is NULL, the handle cannot be inherited.

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 Value

TRUE if the function succeeds, FALSE if the function fails

To get extended error information, call GetLastError.

Remarks

Some file systems, such as NTFS, support compression for individual files and directories. On volumes formatted for such a file system, a new directory inherits the compression attribute of its parent directory.

Requirements

Minimum Supported Version RTX64 2013
Header windows.h
Library Rtx_Rtss.lib

See Also:

CreateFile