createDirectory(atPath:attributes:)
Creates a directory (without contents) at a given path with given attributes.
Declaration
func createDirectory(atPath path: String, attributes: [AnyHashable : Any] = [:]) -> BoolParameters
- 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
nilforattributes, 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, Supporting Types. Some of the keys, such asNSFileHFSCreatorCodeandNSFileHFSTypeCode, do not apply to directories.
Return Value
Discussion
Because this method does not return error information, it has been deprecated as of OS X v10.5. Use createDirectory(atPath:withIntermediateDirectories:attributes:) instead.
See Also
Related Documentation
changeCurrentDirectoryPath(_:)createDirectory(atPath:withIntermediateDirectories:attributes:)createFile(atPath:contents:attributes:)setAttributes(_:ofItemAtPath:)currentDirectoryPath
Deprecated Methods
changeFileAttributes(_:atPath:)fileAttributes(atPath:traverseLink:)fileSystemAttributes(atPath:)directoryContents(atPath:)createSymbolicLink(atPath:pathContent:)pathContentOfSymbolicLink(atPath:)fileManager(_:shouldProceedAfterError:)fileManager(_:willProcessPath:)replaceItemAtURL(originalItemURL:withItemAtURL:backupItemName:options:)