Instance Method


Creates a directory (without contents) at a given path with given attributes.


- (BOOL)createDirectoryAtPath:(NSString *)path attributes:(NSDictionary *)attributes;



The path at which to create the new directory. The directory to be created must not yet exist, but its parent directory must exist.


The file attributes for the new directory. The attributes you can set are owner and group numbers, file permissions, and modification date. If you specify nil for attributes, default values for these attributes are set (particularly write access for the creator and read access for others). For a list of keys you can include in this dictionary, Constants. Some of the keys, such as NSFileHFSCreatorCode and NSFileHFSTypeCode, do not apply to directories.

Return Value

YES if the operation was successful, otherwise NO.


Because this method does not return error information, it has been deprecated as of OS X v10.5. Use createDirectoryAtPath:withIntermediateDirectories:attributes:error: instead.

See Also

Related Symbols

- changeCurrentDirectoryPath:

Changes the path of the current working directory to the specified path.

- createDirectoryAtPath:withIntermediateDirectories:attributes:error:

Creates a directory with given attributes at the specified path.

- createFileAtPath:contents:attributes:

Creates a file with the specified content and attributes at the given location.

- setAttributes:ofItemAtPath:error:

Sets the attributes of the specified file or directory.


The path to the program’s current directory.