Instance Method

createDirectoryAtPath:attributes:

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

Declaration

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

Parameters

path

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

attributes

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.

Discussion

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.

currentDirectoryPath

The path to the program’s current directory.