<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/DataCacheHandler/close(_:context:replyHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(pl)FSVolumeDataCacheHandler(im)closeItem:context:replyHandler:"
  },
  "title" : "close(_:context:replyHandler:)"
}
-->

# close(_:context:replyHandler:)

Closes an item and releases associated cache resources.

```
func close(_ item: FSItem, context: FSContext, replyHandler reply: @escaping @Sendable () -> Void)
```

```
func close(_ item: FSItem, context: FSContext) async
```

## Parameters

`item`

The item to close.

`context`

An object that enables context-aware file system decisions throughout the operation.

`reply`

A block or closure to call when the close operation completes.

## Discussion

FSKit calls this method when fully closing a file, and after the kernel finalizes all caching for the item.

Your module receives this call once per item when all references are released and the kernel
has completed its cache management. The module performs any necessary cleanup
operations for the item.

> Note: This method doesn’t return or throw an error because the OS considers the file closed regardless
> of whether the module encounters any issues during cleanup.

---

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)