<!--
{
  "availability" : [
    "macOS: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(cs)FSVolume"
  },
  "title" : "FSVolume"
}
-->

# FSVolume

A directory structure for files and folders.

```
class FSVolume
```

## Overview

A file system, depending on its type, provides one or more volumes to clients.
The [`FSUnaryFileSystem`](/documentation/FSKit/FSUnaryFileSystem) by definition provides only one volume, while an [`FSFileSystem`](/documentation/FSKit/FSFileSystem) supports multiple volumes.

You implement a volume for your file system type by subclassing this class, and also conforming to the [`FSVolume.Handler`](/documentation/FSKit/FSVolume/Handler) and [`FSVolume.PathConfOperations`](/documentation/FSKit/FSVolume/PathConfOperations) protocols.
This protocol defines the minimum set of operations supported by a volume, such as mounting, activating, creating and removing items, and more.

Your volume can provide additional functionality by conforming to other volume handler protocols.
These protocols add support for operations like open and close, read and write, extended attribute (Xattr) manipulation, and more.

## Topics

### Creating a volume

[`init(volumeID:volumeName:)`](/documentation/FSKit/FSVolume/init(volumeID:volumeName:))

Creates a volume with the given identifier and name.

[`FSVolume.Identifier`](/documentation/FSKit/FSVolume/Identifier)

A type that identifies a volume.

[`FSFileName`](/documentation/FSKit/FSFileName)

The name of a file, expressed as a data buffer.

### Accessing volume properties

[`volumeID`](/documentation/FSKit/FSVolume/volumeID)

An identifier that uniquely identifies the volume.

[`name`](/documentation/FSKit/FSVolume/name)

The name of the volume.

### Implementing required handlers

[`FSVolume.Handler`](/documentation/FSKit/FSVolume/Handler)

Methods that all volumes implement to provide required capabilities.

[`FSVolumeHandlerResult`](/documentation/FSKit/FSVolumeHandlerResult)

An abstract base class for all result objects in FSKit handler-style protocols.

[`FSVolume.PathConfOperations`](/documentation/FSKit/FSVolume/PathConfOperations)

Properties implemented by volumes that support providing the values of system limits or options.

### Implementing optional handlers

[`FSVolume.OpenCloseHandler`](/documentation/FSKit/FSVolume/OpenCloseHandler)

Methods and properties implemented by volumes that want to receive open and close calls for each item.

[`FSVolume.ReadWriteHandler`](/documentation/FSKit/FSVolume/ReadWriteHandler)

Methods implemented for read and write operations that deliver data to and from the extension.

[`FSVolume.AccessCheckHandler`](/documentation/FSKit/FSVolume/AccessCheckHandler)

Methods and properties implemented by volumes that want to enforce access check operations.

[`FSVolume.RenameHandler`](/documentation/FSKit/FSVolume/RenameHandler)

Methods and properties implemented by volumes that support renaming the volume.

[`FSVolume.PreallocateHandler`](/documentation/FSKit/FSVolume/PreallocateHandler)

Methods and properties implemented by volumes that want to offer preallocation functions.

[`FSVolume.XattrHandler`](/documentation/FSKit/FSVolume/XattrHandler)

Methods and properties implemented by volumes that natively or partially support extended attributes.

[`FSVolume.ItemDeactivationHandler`](/documentation/FSKit/FSVolume/ItemDeactivationHandler)

Methods and properties implemented by volumes that support deactivating items.

[`FSVolume.KernelOffloadedIOHandler`](/documentation/FSKit/FSVolume/KernelOffloadedIOHandler)

Methods and properties implemented by volumes that use kernel-offloaded I/O to achieve higher file transfer performance.

[`FSVolume.DataCacheHandler`](/documentation/FSKit/FSVolume/DataCacheHandler)

Methods and properties implemented by volumes that coordinate kernel-level data caching.

[`FSVolume.SeekRegionHandler`](/documentation/FSKit/FSVolume/SeekRegionHandler)

Methods and properties implemented by volumes that support seek operations

### Managing caching behavior

[`setCacheState(for:cacheMode:coherencyType:action:)`](/documentation/FSKit/FSVolume/setCacheState(for:cacheMode:coherencyType:action:))

Sends a synchronous cache state update request from the module to the kernel.

[`FSItem`](/documentation/FSKit/FSItem)

A distinct object in a file hierarchy, such as a file, directory, symlink, socket, and more.

[`FSVolume.DataCacheMode`](/documentation/FSKit/FSVolume/DataCacheMode)

A type that defines the cache mode requested by the kernel for data operations.

[`FSVolume.KernelCacheCoherencyType`](/documentation/FSKit/FSVolume/KernelCacheCoherencyType)

A type that defines how the kernel caches data.

[`FSVolume.KernelCacheCoherencyAction`](/documentation/FSKit/FSVolume/KernelCacheCoherencyAction)

A type that defines actions for cache state changes.

### Deprecated

Migrate your code to the handler-style protocols instead of these operation protocols.

[`FSVolume.Operations`](/documentation/FSKit/FSVolume/Operations)

Methods that all volumes implement to provide required capabilities.

[`FSVolume.OpenCloseOperations`](/documentation/FSKit/FSVolume/OpenCloseOperations)

Methods and properties implemented by volumes that want to receive open and close calls for each item.

[`FSVolume.ReadWriteOperations`](/documentation/FSKit/FSVolume/ReadWriteOperations)

Methods implemented for read and write operations that deliver data to and from the extension.

[`FSVolume.AccessCheckOperations`](/documentation/FSKit/FSVolume/AccessCheckOperations)

Methods and properties implemented by volumes that want to enforce access check operations.

[`FSVolume.RenameOperations`](/documentation/FSKit/FSVolume/RenameOperations)

Methods and properties implemented by volumes that support renaming the volume.

[`FSVolume.PreallocateOperations`](/documentation/FSKit/FSVolume/PreallocateOperations)

Methods and properties implemented by volumes that want to offer preallocation functions.

[`FSVolume.XattrOperations`](/documentation/FSKit/FSVolume/XattrOperations)

Methods and properties implemented by volumes that natively or partially support extended attributes.

[`FSVolume.ItemDeactivation`](/documentation/FSKit/FSVolume/ItemDeactivation)

Methods and properties implemented by volumes that support deactivating items.

[`FSVolumeKernelOffloadedIOOperations`](/documentation/FSKit/FSVolumeKernelOffloadedIOOperations)

Methods and properties implemented by volumes that use kernel-offloaded I/O to achieve higher file transfer performance.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)