BOOL CreateDirectory(lpszPath, lpsa) | |||||
LPTSTR lpszPath; | /* path name of directory to create | */ | |||
LPSECURITY_ATTRIBUTES lpsa; | /* optional security descriptor | */ |
The CreateDirectory function creates a new directory.
lpszPath
Points to a null-terminated string specifying the pathname of the directory to be created.
lpsa
Points to a SECURITY_ATTRIBUTES data structure that specifies the security attributes for the directory. The file system must support this parameter for it to have an effect.
The SECURITY_ATTRIBUTES structure has the following format:
typedef struct _SECURITY_ATTRIBUTES { /* sa */
DWORD nLength;
LPVOID lpSecurityDescriptor;
BOOL bInheritHandle;
} SECURITY_ATTRIBUTES;
The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.
The CreateDirectory function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).
RemoveDirectory