Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.67 KB

CreateDirectory.md

File metadata and controls

57 lines (36 loc) · 1.67 KB

Home

Function name : CreateDirectory

Group: File Management - Library: kernel32


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.


Code examples:

Creating a folder

Declaration:

BOOL CreateDirectory(
  LPCTSTR lpPathName,                         // directory name
  LPSECURITY_ATTRIBUTES lpSecurityAttributes  // SD
);  

FoxPro declaration:

DECLARE INTEGER CreateDirectory IN kernel32;
	STRING  lpPathName,;
	INTEGER lpSecurityAttributes
  

Parameters:

lpPathName [in] Pointer to a null-terminated string that specifies the path of the directory to be created

lpSecurityAttributes Windows NT/2000: [in] 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 value:

If the function succeeds, the return value is nonzero


Comments:

If one or more intermediate directories do not exist, no directory is created (error code 3). To create all intermediate directories on the path, use the SHCreateDirectory function.

See also: SHCreateDirectory.