Returns the attributes of the item at a given path.
- iOS 2.0+
- macOS 10.5+
- UIKit for Mac 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The path of a file or directory.
On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify
nilfor this parameter if you do not want the error information.
NSDictionary object that describes the attributes (file, directory, symlink, and so on) of the file specified by
nil if an error occurred. The keys in the dictionary are described in File Attribute Keys.
If the item at the path is a symbolic link—that is, the value of the
NSFile key in the attributes dictionary is
NSFile—you can use the
destination method to retrieve the path of the item pointed to by the link. You can also use the
string method of
NSString to resolve links in the path before retrieving the item’s attributes.
As a convenience,
NSDictionary provides a set of methods (declared as a category on
NSDictionary) for quickly and efficiently obtaining attribute information from the returned dictionary: