---
title: FSVolume.OpenCloseHandler
framework: fskit
role: symbol
role_heading: Protocol
path: fskit/fsvolume/openclosehandler
---

# FSVolume.OpenCloseHandler

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

## Declaration

```swift
protocol OpenCloseHandler : NSObjectProtocol
```

## Overview

Overview When a file system volume conforms to this protocol, the kernel layer issues an open call to indicate desired access, and a close call to indicate what access to retain. A file is fully closed when the kernel layer issues a close call with no retained open nodes. When a file system receives the close call, it removes all access to the item. When all memory mappings to the item release, the kernel layer issues a final close. If a file system volume doesn’t conform to this protocol, the kernel layer can skip making such calls to the volume. important: This protocol replaces the FSVolume.OpenCloseOperations protocol. It exposes the same functionality, while adding the FSContext parameters.

## Topics

### Opening and closing

- [openItem(_:modes:context:replyHandler:)](fskit/fsvolume/openclosehandler/openitem(_:modes:context:replyhandler:).md)
- [closeItem(_:modes:context:replyHandler:)](fskit/fsvolume/openclosehandler/closeitem(_:modes:context:replyhandler:).md)
- [FSVolume.OpenModes](fskit/fsvolume/openmodes.md)
- [FSContext](fskit/fscontext.md)

### Inspecting volume properties

- [isOpenCloseInhibited](fskit/fsvolume/openclosehandler/isopencloseinhibited.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Implementing optional handlers

- [FSVolume.ReadWriteHandler](fskit/fsvolume/readwritehandler.md)
- [FSVolume.AccessCheckHandler](fskit/fsvolume/accesscheckhandler.md)
- [FSVolume.RenameHandler](fskit/fsvolume/renamehandler.md)
- [FSVolume.PreallocateHandler](fskit/fsvolume/preallocatehandler.md)
- [FSVolume.XattrHandler](fskit/fsvolume/xattrhandler.md)
- [FSVolume.ItemDeactivationHandler](fskit/fsvolume/itemdeactivationhandler.md)
- [FSVolume.KernelOffloadedIOHandler](fskit/fsvolume/kerneloffloadediohandler.md)
- [FSVolume.DataCacheHandler](fskit/fsvolume/datacachehandler.md)
- [FSVolume.SeekRegionHandler](fskit/fsvolume/seekregionhandler.md)
