URLs to file system resources support the properties defined below. Note that not all property values will exist for all file system URLs. For example, if a file is located on a volume that does not support creation dates, it is valid to request the creation date property, but the returned value will be nil, and no error will be generated.
- iOS 10.0+
- macOS 10.12+
- tvOS 10.0+
- watchOS 3.0+
- Xcode 8.0+
Only the fields requested by the keys you pass into the
URL function to receive this value will be populated. The others will return
nil regardless of the underlying property on the file system.
As a convenience, volume resource values can be requested from any file system URL. The value returned will reflect the property value for the volume on which the resource is located.
var addedToDirectoryDate: Date?
The date the resource was created, or renamed into or within its parent directory. Note that inconsistent behavior may be observed when this attribute is requested on hard-linked items. This property is not supported by all volumes.
var customIcon: NSImage?
var documentIdentifier: Int?
The document identifier – a value assigned by the kernel to a document (which can be either a file or directory) and is used to identify the document regardless of where it gets moved on a volume.
var effectiveIcon: AnyObject?
var isExecutable: Bool?
True if this process (as determined by EUID) can execute a file resource or search a directory resource.
var isMountTrigger: Bool?
True if this URL is a file system trigger directory. Traversing or opening a file system trigger will cause an attempt to mount a file system on the trigger directory.
var labelColor: NSColor?
var thumbnail: NSImage?
var thumbnailDictionary: [URLThumbnailSizeKey : UIImage]?
var thumbnailDictionary: [URLThumbnailSizeKey : NSImage]?
var totalFileAllocatedSize: Int?
Total allocated size of the file in bytes (this may include space used by metadata), or nil if not available. This can be less than the value returned by
totalFileSize if the resource is compressed.
var totalFileSize: Int?
Total displayable size of the file in bytes (this may include space used by metadata), or nil if not available.
var volumeIsAutomounted: Bool?
true if the volume is automounted. Note: do not mistake this with the functionality provided by kCFURLVolumeSupportsBrowsingKey.
var volumeIsInternal: Bool?
true if the volume’s device is connected to an internal bus, false if connected to an external bus, or nil if not available.
var volumeSupportsCasePreservedNames: Bool?
true if the volume format preserves the case of file and directory names. Otherwise the volume may change the case of some characters (typically making them all upper or all lower case).
var volumeSupportsCaseSensitiveNames: Bool?
true if the volume format treats upper and lower case characters in file and directory names as different. Otherwise an upper case character is equivalent to a lower case character, and you can’t have two names that differ solely in the case of the characters.
var volumeSupportsJournaling: Bool?
true if the volume format supports a journal used to speed recovery in case of unplanned restart (such as a power outage or crash). This does not necessarily mean the volume is actively using a journal.
var volumeSupportsSparseFiles: Bool?
true if the volume format supports sparse files, that is, files which can have ‘holes’ that have never been written to, and thus do not consume space on disk. A sparse file may have an allocated size on disk that is less than its logical length.
var volumeSupportsZeroRuns: Bool?
For security reasons, parts of a file (runs) that have never been written to must appear to contain zeroes. true if the volume keeps track of allocated but unwritten runs of a file so that it can substitute zeroes without actually writing zeroes to the media.