Changes the attributes of a given file or directory.
- iOS 2.0–2.0Deprecated
- macOS 10.0–10.5Deprecated
- tvOS 9.0–9.0Deprecated
- watchOS 2.0–2.0Deprecated
A dictionary containing as keys the attributes to set for
pathand as values the corresponding value for the attribute. You can set following:
Group Owner Account ID
Group Owner Account Name
Owner Account ID
Owner Account Name
NSFile. You can change single attributes or any combination of attributes; you need not specify keys for all attributes.
NSFilevalue, specify a file mode from the OR’d permission bit masks defined in
sys/stat. See the man page for the
man 2 chmod) for an explanation.
A path to a file or directory.
YES if all changes succeed. If any change fails, returns
NO, but it is undefined whether any changes actually occurred.
As in the POSIX standard, the app either must own the file or directory or must be running as superuser for attribute changes to take effect. The method attempts to make all changes specified in attributes and ignores any rejection of an attempted modification.
NSFile value must be initialized with the code representing the POSIX file-permissions bit pattern.
NSFile will only be heeded when
path specifies a file.
Because this method does not return error information, it has been deprecated as of OS X v10.5. Use