TechnologiesData, Storage & Cloud

FSKit

iOSmacOStvOSwatchOSvisionOS

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.

  • Cl
    FSClientmacOS 15.4+
    An interface for apps and daemons to interact with FSKit.
  • Cl
    FSModuleIdentitymacOS 15.4+
    An installed file system module.
  • Cl
    FSContainerIdentifiermacOS 15.4+
    A type that identifies a container.
  • Cl
    FSEntityIdentifiermacOS 15.4+
    A base type that identifies containers and volumes.
  • Cl
    FSContextmacOS 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.

  • Cl
    FSVolumemacOS 15.4+
    A directory structure for files and folders.
  • Cl
    FSContainerStatus
    A type that represents a container's status.
  • En
    FSContainerStatemacOS 15.4+
    An enumeration of container state values.
  • Cl
    FSUnaryFileSystemmacOS 15.4+
    An abstract base class for implementing a minimal file system.
  • Cl
    FSStatFSResultmacOS 15.4+
    A type used to report a volume's statistics.
  • Cl
    FSFreeSpacemacOS 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.

  • Cl
    FSItemmacOS 15.4+
    A distinct object in a file hierarchy, such as a file, directory, symlink, socket, and more.
  • Cl
    FSFileNamemacOS 15.4+
    The name of a file, expressed as a data buffer.
  • Cl
    FSDirectoryEntryPackermacOS 15.4+
    An object used to provide items during a directory enumeration.
  • Cl
    FSExtentPackermacOS 15.4+
    A type that directs the kernel to map space on disk to a specific file managed by this file system.
  • Cl
    FSMutableFileDataBuffermacOS 15.4+
    A wrapper object for a data buffer.
  • Cl
    FSMetadataRange
    A 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.

  • Pr
    FSFileSystemBasemacOS 15.4+
    A protocol containing functionality supplied by FSKit to file system implementations.
  • Pr
    FSUnaryFileSystemOperationsmacOS 15.4+
    Operations performed by a unary file system.
  • Pr
    FSVolumeKernelOffloadedIOOperations
    Methods and properties implemented by volumes that use kernel-offloaded I/O to achieve higher file transfer performance.
  • Pr
    FSManageableResourceMaintenanceOperationsmacOS 15.4+
    Maintenance operations for a file system's resources.
  • Pr
    UnaryFileSystemExtension
    A 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.

  • Cl
    FSResourcemacOS 15.4+
    An abstract resource a file system uses to provide data for a volume.
  • Cl
    FSBlockDeviceResourcemacOS 15.4+
    A resource that represents a block storage disk partition.
  • Cl
    FSPathURLResourcemacOS 26.0+
    A resource that represents a path in the system file space.
  • Cl
    FSGenericURLResourcemacOS 26.0+
    A resource that represents an abstract URL.
  • Cl
    FSProbeResultmacOS 15.4+
    An object that represents the results of a specific probe.
  • En
    FSMatchResultmacOS 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.

  • Cl
    FSTaskmacOS 15.4+
    A class that enables a file system module to pass log messages and completion notifications to clients.
  • Cl
    FSTaskOptionsmacOS 15.4+
    A class that passes command options to a task, optionally providing security-scoped URLs.
  • St
    FSOperationIDmacOS 15.4+
    A unique identifier for an operation.
  • Cl
    FSVolumeHandlerResultmacOS 27.0+
    Abstract base class for all result objects in FSKit `Handler` protocols.
  • Cl
    FSActivateResultmacOS 27.0+
    Result class for ``FSVolume/Handler/activate(options:replyHandler:)``
  • St
    FSDeactivateOptionsmacOS 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.

  • Cl
    FSLookupItemResultmacOS 27.0+
    Result class for ``FSVolume/Handler/lookupItem(named:in:replyHandler:)``
  • Cl
    FSCreateItemResultmacOS 27.0+
    Result class for ``FSVolume/Handler/createItem(named:type:in:attributes:replyHandler:)``
  • Cl
    FSCreateSymlinkResultmacOS 27.0+
    Result class for ``FSVolume/Handler/createSymbolicLink(named:in:attributes:linkContents:replyHandler:)``
  • Cl
    FSCreateLinkResultmacOS 27.0+
    Result class for ``FSVolume/Handler/createLink(to:named:in:replyHandler:)``
  • Cl
    FSRenameItemResultmacOS 27.0+
    Result class for ``FSVolume/Handler/renameItem(_:inDirectory:named:to:inDirectory:overItem:replyHandler:)``
  • Cl
    FSRemoveItemResultmacOS 27.0+
    Result class for``FSVolume/Handler/removeItem(_:named:from:replyHandler:)``
  • Cl
    FSGetAttributesResultmacOS 27.0+
    Result class for ``FSVolume/Handler/getAttributes(_:of:replyHandler:)``
  • Cl
    FSSetAttributesResultmacOS 27.0+
    Result class for ``FSVolume/Handler/setAttributes(_:on:replyHandler:)``
  • Cl
    FSEnumerateDirectoryResultmacOS 27.0+
    Result class for ``FSVolume/Handler/enumerateDirectory(_:startingAt:verifier:attributes:packer:replyHandler:)``
  • Cl
    FSReadSymlinkResultmacOS 27.0+
    Result class for ``FSVolume/Handler/readSymbolicLink(_:replyHandler:)``
  • Cl
    FSOpenItemResultmacOS 27.0+
    Result class for ``FSVolume/DataCacheHandler/open(_:modes:cacheMode:context:replyHandler:)``
  • Cl
    FSUpgradeItemResultmacOS 27.0+
    Result class for ``FSVolume/DataCacheHandler/upgrade(_:cacheMode:context:replyHandler:)``
  • Cl
    FSDeactivateItemResultmacOS 27.0+
    Result class for ``FSVolume/ItemDeactivationHandler/deactivateItem(_:replyHandler:)``
  • Cl
    FSCheckAccessResultmacOS 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.

  • Cl
    FSGetXattrResultmacOS 27.0+
    Result class for ``FSVolume/XattrHandler/getXattr(named:of:replyHandler:)``
  • Cl
    FSSetXattrResultmacOS 27.0+
    Result class for ``FSVolume/XattrHandler/setXattr(named:to:on:policy:replyHandler:)``
  • Cl
    FSListXattrsResultmacOS 27.0+
    Result class for ``FSVolume/XattrHandler/xattrs(of:)``

File I/O Results 7

Return values for reading, writing, mapping, and allocating file data.

  • Cl
    FSReadFileResultmacOS 27.0+
    Result class for ``FSVolume/ReadWriteHandler/read(from:at:length:into:replyHandler:)``
  • Cl
    FSWriteFileResultmacOS 27.0+
    Result class for ``FSVolume/ReadWriteHandler/write(contents:to:at:replyHandler:)``
  • Cl
    FSPreallocateResultmacOS 27.0+
    Result class for ``FSVolume/PreallocateHandler/preallocateSpace(for:at:length:flags:replyHandler:)``
  • Cl
    FSSeekRegionResultmacOS 27.0+
    Result class for ``FSVolume/SeekRegionHandler/seek(within:from:region:context:replyHandler:)``
  • Cl
    FSBlockmapResultmacOS 27.0+
    Result class for ``FSVolume/KernelOffloadedIOHandler/blockmapFile(_:offset:length:flags:operationID:packer:replyHandler:)``
  • Cl
    FSCompleteIOResultmacOS 27.0+
    Result class for ``FSVolume/KernelOffloadedIOHandler/completeIO(for:offset:length:status:flags:operationID:providing:replyHandler:)``
  • Cl
    FSVolumeRenameResultmacOS 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.

  • Cl
    FSCreateFileKOIOResultmacOS 27.0+
    Result class for ``FSVolume/KernelOffloadedIOHandler/createFile(named:in:attributes:packer:replyHandler:)``
  • Cl
    FSLookupItemKOIOResultmacOS 27.0+
    Result class for ``FSVolume/KernelOffloadedIOHandler/lookupItem(named:in:packer:replyHandler:)``
  • Cl
    FSPreallocateKOIOResultmacOS 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.

  • St
    FSDirectoryCookiemacOS 15.4+
    A value that indicates a location in a directory from which to enumerate.
  • St
    FSDirectoryVerifiermacOS 15.4+
    A tool to detect whether the directory contents changed since the last call to enumerate a directory.
  • En
    FSSyncFlagsmacOS 15.4+
    Behavior flags for use with synchronization calls.
  • St
    FSBlockmapFlagsmacOS 15.4+
    Flags that describe the behavior of a blockmap operation.
  • St
    FSCompleteIOFlagsmacOS 15.4+
    Flags that describe the behavior of an I/O completion operation.
  • En
    FSExtentTypemacOS 15.4+
    An enumeration of types of extents.

Errors 2

Report failures that occur while interacting with or implementing a file system.

  • St
    FSError
    A structure that describes an error raised while interacting with a file system.
  • St
    FSDataCacheErrormacOS 27.0+
    A structure that describes an error in the file system's data cache.
← Data, Storage & Cloud