Contents

FSKit

Implement a file system that runs in user space.

Overview

With FSKit, you can extend macOS by enabling access to new types of file systems. You do this by developing an FSKit module (FSModule), which you deliver as an app extension that runs in user space, and is compatible with Mac App Store distribution. FSKit connects your module to the system’s existing frameworks and tools, like Disk Arbitration, NetFS, and the mount(8) command.

FSKit modules

An FSKit module consists of two main parts:

  • A set of module attributes that you define in the module’s Info.plist file. These attributes provide metadata like Boolean keys that indicate feature support and dictionaries that describe command-line interface access.

  • The code that implements the file system functionality. Your app extension conforms to one of two protocols, depending on its design flow, as described below.

The FSKit framework defines three key file storage concepts that FSModule supports:

Volume

A directory structure for files and folders.

Resource

A source of data, such as a block storage device or a network resource you identify with a URL.

Container

An abstract object that uses one or more resources to deliver one or more volumes, similar to an APFS container. Typically, a container uses only one resource, but some formats like Xsan (Apple’s cluster file system) use multiple disks to store contents for one volume.

Design flows

FSKit provides two design flows, with different trade-offs of functionality and complexity:

  • FSFileSystem is a conventional, full-featured file system that can employ multiple resources and deliver multiple volumes.

  • FSUnaryFileSystem is a simpler file system where containers use only one resource and provide only one volume. Most file systems shipping in macOS fit this pattern, including HFS, msdosfs, ExFAT, ntfs, and others.

When you choose a design flow, write an app extension that conforms to either FileSystemExtension or UnaryFileSystemExtension, based on your chosen flow. These protocols declare a fileSystem delegate object that your extension creates and returns. This delegate object subclasses either FSFileSystem or FSUnaryFileSystem as appropriate, and conforms to either the FSFileSystemOperations or FSUnaryFileSystemOperations protocol. These protocols define a loadResource method, which FSKit uses to make a resource available to the module.

Topics

Essentials

App extensions

File systems

Containers

Resources

Volumes

Items

Maintenance and management

Operations

Tasks

Errors and logging

FSKit interactions

Supporting types

Entitlements