createDirectoryAtPath:withIntermediateDirectories:attributes:error:
Creates a directory with given attributes at a specified path.
Parameters
-
path
-
The path at which to create the new directory. The directory to be created must not yet exist.
createIntermediates
-
If
YES
, then the method will also create any necessary intermediate directories; ifNO
, then the method fails if any parent of the directory to be created does not exist. In addition, if you passNO
for this parameter, the directory must not exist at the time this call is made.
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, the directory is created according to the umask of the process. The “Constants” section lists the global constants used as keys in the attributesdictionary. Some of the keys, such asNSFileHFSCreatorCode
andNSFileHFSTypeCode
, do not apply to directories.
error
-
If an error occurs, upon return contains an
NSError
object that describes the problem. PassNULL
if you do not want error information.
Return Value
YES
if the operation was successful or already exists, otherwise NO
.