<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/XattrHandler/listXattrs(of:context:replyHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(pl)FSVolumeXattrHandler(im)listXattrsOfItem:context:replyHandler:"
  },
  "title" : "listXattrs(of:context:replyHandler:)"
}
-->

# listXattrs(of:context:replyHandler:)

Gets the list of extended attributes currently set on the given item.

```
func listXattrs(of item: FSItem, context: FSContext, replyHandler reply: @escaping @Sendable (FSListXattrsResult?, (any Error)?) -> Void)
```

```
func xattrs(of item: FSItem, context: FSContext) async throws -> FSListXattrsResult
```

## Parameters

`item`

The item from which to get extended attributes.

`context`

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

`reply`

A block or closure to indicate success or failure. If getting the list of extended attributes succeeds, pass an instance of [`FSListXattrsResult`](/documentation/FSKit/FSListXattrsResult) containing the xattrs as an array of [`FSFileName`](/documentation/FSKit/FSFileName) instances, along with a `nil` error. If getting the attributes fails, pass the relevant error as the second parameter; FSKit ignores the [`FSListXattrsResult`](/documentation/FSKit/FSListXattrsResult) instance in this case. For an `async` Swift implementation, there’s no reply handler; simply return the result instance or throw an error.

---

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)