---
title: "reclaimItem(_:replyHandler:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsvolume/handler/reclaimitem(_:replyhandler:)"
---

# reclaimItem(_:replyHandler:)

Reclaims an item, releasing any resources allocated for the item.

## Declaration

```swift
func reclaimItem(_ item: FSItem, replyHandler reply: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func reclaimItem(_ item: FSItem) async throws
```

## Parameters

- `item`: The item to reclaim.

## Discussion

Discussion ::::: Swift :::::::::: reply: A block or closure to indicate success or failure. If removal fails, pass an error as the one parameter to the reply handler. If removal succeeds, pass nil. For an async Swift implementation, there’s no reply handler; simply throw an error or return normally. :::::::::::::::::::: ::::: ObjC :::::::::: error: A block or closure to indicate success or failure. If removal fails, pass an error as the one parameter to the reply handler. If removal succeeds, pass nil. For an async Swift implementation, there’s no reply handler; simply throw an error or return normally. :::::::::::::::::::: Discussion FSKit guarantees that for every FSItem returned by the volume, a corresponding reclaim operation occurs after the upper layers no longer reference that item. To use this behavior, call tryReclaim(_:) in your implementation of this method. note: Block device file systems may assess whether an underlying resource terminates before processing reclaim operations. On unary file systems, for example, the associated volumes unmount when such resources disconnect from the system. The unmount triggers a reclaiming of all items. Some implementations benefit greatly from short-circuiting in such cases. With a terminated resource, all I/O results in an error, making short-circuiting the most efficient response.

## See Also

### Working with items

- [createItem(named:type:in:attributes:context:replyHandler:)](fskit/fsvolume/handler/createitem(named:type:in:attributes:context:replyhandler:).md)
- [FSFileName](fskit/fsfilename.md)
- [FSItem.ItemType](fskit/fsitem/itemtype.md)
- [FSItem.SetAttributesRequest](fskit/fsitem/setattributesrequest.md)
- [FSCreateItemResult](fskit/fscreateitemresult.md)
- [lookupItem(named:in:context:replyHandler:)](fskit/fsvolume/handler/lookupitem(named:in:context:replyhandler:).md)
- [FSLookupItemResult](fskit/fslookupitemresult.md)
- [removeItem(_:named:from:context:replyHandler:)](fskit/fsvolume/handler/removeitem(_:named:from:context:replyhandler:).md)
- [FSRemoveItemResult](fskit/fsremoveitemresult.md)
- [renameItem(_:inDirectory:named:to:inDirectory:overItem:context:replyHandler:)](fskit/fsvolume/handler/renameitem(_:indirectory:named:to:indirectory:overitem:context:replyhandler:).md)
- [FSRenameItemResult](fskit/fsrenameitemresult.md)
