A representation of a node (a file, directory, or symbolic link) in the file system.
SDKs
- iOS 4.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
class FileWrapper : NSObject
Overview
The File
class provides access to the attributes and contents of file system nodes. A file system node is a file, directory, or symbolic link. Instances of this class are known as file wrappers.
Note
Starting in macOS 10.7, File
moved from Application Kit to Foundation. As a result of this the icon
, and set
methods have moved to a new category of File
that remains in Application Kit.
File wrappers represent a file system node as an object that can be displayed as an image (and possibly edited in place), saved to the file system, or transmitted to another application.
There are three types of file wrappers:
Regular-file file wrapper: Represents a regular file.
Directory file wrapper: Represents a directory.
Symbolic-link file wrapper: Represents a symbolic link.
A file wrapper has these attributes:
Filename. Name of the file system node the file wrapper represents.
file-system attributes. See
File
for information on the contents of theManager attributes
dictionary.Regular-file contents. Applicable only to regular-file file wrappers.
File wrappers. Applicable only to directory file wrappers.
Destination node. Applicable only to symbolic-link file wrappers.