---
title: "closeItem(_:modes:replyHandler:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsvolume/opencloseoperations/closeitem(_:modes:replyhandler:)"
---

# closeItem(_:modes:replyHandler:)

Closes a file from further access.

## Declaration

```swift
func closeItem(_ item: FSItem, modes: FSVolume.OpenModes, replyHandler reply: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func closeItem(_ item: FSItem, modes: FSVolume.OpenModes) async throws
```

## Parameters

- `item`: The item to close.
- `modes`: The set of mode flags to keep after this close.
- `reply`: A block or closure to indicate success or failure. If closing fails, pass an error as the one parameter to the reply handler. If closing succeeds, pass nil. For an async Swift implementation, there’s no reply handler; simply throw an error or return normally.
