FSKit provides an interface for apps and daemons on macOS to discover and interact with file-system extensions installed on the system. Through types such as FSClient, FSResource, and FSVolume, your app connects to a file system and works with its containers, items, and volumes, while FSContainerStatus and FSContainerState report the current condition of a mounted container. To implement a file-system extension itself, you conform to protocols including FSFileSystemBase, FSUnaryFileSystemOperations, and FSVolumeKernelOffloadedIOOperations, backing a file system with resources like FSBlockDeviceResource, FSPathURLResource, or FSGenericURLResource and reporting failures through FSError. Supporting types such as FSItem, FSFileName, FSDirectoryEntryPacker, FSExtentPacker, and FSStatFSResult model the entities, naming, and operations that a file system exposes.
Essentials 5
Discover, connect to, and identify file-system extensions installed on the system.
- ClFSClientmacOS 15.4+An interface for apps and daemons to interact with FSKit.
- ClFSModuleIdentitymacOS 15.4+An installed file system module.
- ClFSContainerIdentifiermacOS 15.4+A type that identifies a container.
- ClFSEntityIdentifiermacOS 15.4+A base type that identifies containers and volumes.
- ClFSContextmacOS 27.0+A context object that provides information about the initiator of a file system operation.
Containers and Volumes 6
Model mounted containers and the volumes a file system exposes, along with their current state.
- ClFSVolumemacOS 15.4+A directory structure for files and folders.
- ClFSContainerStatusA type that represents a container's status.
- EnFSContainerStatemacOS 15.4+An enumeration of container state values.
- ClFSUnaryFileSystemmacOS 15.4+An abstract base class for implementing a minimal file system.
- ClFSStatFSResultmacOS 15.4+A type used to report a volume's statistics.
- ClFSFreeSpacemacOS 27.0+A free space object that pairs free space values with atomic sequence numbers.
Items and Naming 6
Represent the files, directories, and names that make up a file system's contents.
- ClFSItemmacOS 15.4+A distinct object in a file hierarchy, such as a file, directory, symlink, socket, and more.
- ClFSFileNamemacOS 15.4+The name of a file, expressed as a data buffer.
- ClFSDirectoryEntryPackermacOS 15.4+An object used to provide items during a directory enumeration.
- ClFSExtentPackermacOS 15.4+A type that directs the kernel to map space on disk to a specific file managed by this file system.
- ClFSMutableFileDataBuffermacOS 15.4+A wrapper object for a data buffer.
- ClFSMetadataRangeA range that describes contiguous metadata segments on disk.
Building a File-System Extension 5
Conform to these protocols to implement a file system and its volume operations.
- PrFSFileSystemBasemacOS 15.4+A protocol containing functionality supplied by FSKit to file system implementations.
- PrFSUnaryFileSystemOperationsmacOS 15.4+Operations performed by a unary file system.
- PrFSVolumeKernelOffloadedIOOperationsMethods and properties implemented by volumes that use kernel-offloaded I/O to achieve higher file transfer performance.
- PrFSManageableResourceMaintenanceOperationsmacOS 15.4+Maintenance operations for a file system's resources.
- PrUnaryFileSystemExtensionA protocol for implementing a minimal file system as an app extension.
Backing Resources 6
Provide the storage and device resources that back a file system.
- ClFSResourcemacOS 15.4+An abstract resource a file system uses to provide data for a volume.
- ClFSBlockDeviceResourcemacOS 15.4+A resource that represents a block storage disk partition.
- ClFSPathURLResourcemacOS 26.0+A resource that represents a path in the system file space.
- ClFSGenericURLResourcemacOS 26.0+A resource that represents an abstract URL.
- ClFSProbeResultmacOS 15.4+An object that represents the results of a specific probe.
- EnFSMatchResultmacOS 15.4+A type that represents the recognition and usability of a probed resource.
Tasks and Operations 6
Coordinate the asynchronous work and operation tracking a file system performs.
- ClFSTaskmacOS 15.4+A class that enables a file system module to pass log messages and completion notifications to clients.
- ClFSTaskOptionsmacOS 15.4+A class that passes command options to a task, optionally providing security-scoped URLs.
- StFSOperationIDmacOS 15.4+A unique identifier for an operation.
- ClFSVolumeHandlerResultmacOS 27.0+Abstract base class for all result objects in FSKit `Handler` protocols.
- ClFSActivateResultmacOS 27.0+Result class for ``FSVolume/Handler/activate(options:replyHandler:)``
- StFSDeactivateOptionsmacOS 15.4+Options that affect the behavior of deactivate methods.
Item Operation Results 14
Return values for looking up, creating, modifying, and removing file-system items.
- ClFSLookupItemResultmacOS 27.0+Result class for ``FSVolume/Handler/lookupItem(named:in:replyHandler:)``
- ClFSCreateItemResultmacOS 27.0+Result class for ``FSVolume/Handler/createItem(named:type:in:attributes:replyHandler:)``
- ClFSCreateSymlinkResultmacOS 27.0+Result class for ``FSVolume/Handler/createSymbolicLink(named:in:attributes:linkContents:replyHandler:)``
- ClFSCreateLinkResultmacOS 27.0+Result class for ``FSVolume/Handler/createLink(to:named:in:replyHandler:)``
- ClFSRenameItemResultmacOS 27.0+Result class for ``FSVolume/Handler/renameItem(_:inDirectory:named:to:inDirectory:overItem:replyHandler:)``
- ClFSRemoveItemResultmacOS 27.0+Result class for``FSVolume/Handler/removeItem(_:named:from:replyHandler:)``
- ClFSGetAttributesResultmacOS 27.0+Result class for ``FSVolume/Handler/getAttributes(_:of:replyHandler:)``
- ClFSSetAttributesResultmacOS 27.0+Result class for ``FSVolume/Handler/setAttributes(_:on:replyHandler:)``
- ClFSEnumerateDirectoryResultmacOS 27.0+Result class for ``FSVolume/Handler/enumerateDirectory(_:startingAt:verifier:attributes:packer:replyHandler:)``
- ClFSReadSymlinkResultmacOS 27.0+Result class for ``FSVolume/Handler/readSymbolicLink(_:replyHandler:)``
- ClFSOpenItemResultmacOS 27.0+Result class for ``FSVolume/DataCacheHandler/open(_:modes:cacheMode:context:replyHandler:)``
- ClFSUpgradeItemResultmacOS 27.0+Result class for ``FSVolume/DataCacheHandler/upgrade(_:cacheMode:context:replyHandler:)``
- ClFSDeactivateItemResultmacOS 27.0+Result class for ``FSVolume/ItemDeactivationHandler/deactivateItem(_:replyHandler:)``
- ClFSCheckAccessResultmacOS 27.0+Result class for ``FSVolume/AccessCheckHandler/checkAccess(to:requestedAccess:replyHandler:)``
Extended Attributes 3
Return values for reading, writing, and listing an item's extended attributes.
- ClFSGetXattrResultmacOS 27.0+Result class for ``FSVolume/XattrHandler/getXattr(named:of:replyHandler:)``
- ClFSSetXattrResultmacOS 27.0+Result class for ``FSVolume/XattrHandler/setXattr(named:to:on:policy:replyHandler:)``
- ClFSListXattrsResultmacOS 27.0+Result class for ``FSVolume/XattrHandler/xattrs(of:)``
File I/O Results 7
Return values for reading, writing, mapping, and allocating file data.
- ClFSReadFileResultmacOS 27.0+Result class for ``FSVolume/ReadWriteHandler/read(from:at:length:into:replyHandler:)``
- ClFSWriteFileResultmacOS 27.0+Result class for ``FSVolume/ReadWriteHandler/write(contents:to:at:replyHandler:)``
- ClFSPreallocateResultmacOS 27.0+Result class for ``FSVolume/PreallocateHandler/preallocateSpace(for:at:length:flags:replyHandler:)``
- ClFSSeekRegionResultmacOS 27.0+Result class for ``FSVolume/SeekRegionHandler/seek(within:from:region:context:replyHandler:)``
- ClFSBlockmapResultmacOS 27.0+Result class for ``FSVolume/KernelOffloadedIOHandler/blockmapFile(_:offset:length:flags:operationID:packer:replyHandler:)``
- ClFSCompleteIOResultmacOS 27.0+Result class for ``FSVolume/KernelOffloadedIOHandler/completeIO(for:offset:length:status:flags:operationID:providing:replyHandler:)``
- ClFSVolumeRenameResultmacOS 27.0+Result class for ``FSVolume/RenameHandler/setVolumeName(_:replyHandler:)``
Kernel-Offloaded I/O Results 3
Return values for I/O operations offloaded to the kernel.
- ClFSCreateFileKOIOResultmacOS 27.0+Result class for ``FSVolume/KernelOffloadedIOHandler/createFile(named:in:attributes:packer:replyHandler:)``
- ClFSLookupItemKOIOResultmacOS 27.0+Result class for ``FSVolume/KernelOffloadedIOHandler/lookupItem(named:in:packer:replyHandler:)``
- ClFSPreallocateKOIOResultmacOS 27.0+Result class for ``FSVolume/KernelOffloadedIOHandler/preallocateSpace(for:at:length:flags:packer:replyHandler:)``
Enumeration and Synchronization 6
Track directory enumeration cursors and synchronization options during operations.
- StFSDirectoryCookiemacOS 15.4+A value that indicates a location in a directory from which to enumerate.
- StFSDirectoryVerifiermacOS 15.4+A tool to detect whether the directory contents changed since the last call to enumerate a directory.
- EnFSSyncFlagsmacOS 15.4+Behavior flags for use with synchronization calls.
- StFSBlockmapFlagsmacOS 15.4+Flags that describe the behavior of a blockmap operation.
- StFSCompleteIOFlagsmacOS 15.4+Flags that describe the behavior of an I/O completion operation.
- EnFSExtentTypemacOS 15.4+An enumeration of types of extents.
Errors 2
Report failures that occur while interacting with or implementing a file system.
- StFSErrorA structure that describes an error raised while interacting with a file system.
- StFSDataCacheErrormacOS 27.0+A structure that describes an error in the file system's data cache.