<!--
{
  "availability" : [
    "macOS: 15.4.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/Operations/getAttributes(_:of:replyHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(pl)FSVolumeOperations(im)getAttributes:ofItem:replyHandler:"
  },
  "title" : "getAttributes(_:of:replyHandler:)"
}
-->

# getAttributes(_:of:replyHandler:)

Fetches attributes for the given item.

```
func getAttributes(_ desiredAttributes: FSItem.GetAttributesRequest, of item: FSItem, replyHandler reply: @escaping @Sendable (FSItem.Attributes?, (any Error)?) -> Void)
```

## Parameters

`desiredAttributes`

A requested set of attributes to get. The implementation inspects the request’s [`wantedAttributes`](/documentation/FSKit/FSItem/GetAttributesRequest/wantedAttributes) to determine which attributes to populate.

`item`

The item to get attributes for.

`reply`

A block or closure to indicate success or failure. If getting attributes succeeds, pass an [`FSItem.Attributes`](/documentation/FSKit/FSItem/Attributes) with the requested attributes populated and a `nil` error. If getting attributes fails, pass the relevant error as the second parameter; FSKit ignores any [`FSItem.Attributes`](/documentation/FSKit/FSItem/Attributes) in this case. For an `async` Swift implementation, there’s no reply handler; simply return the [`FSItem.Attributes`](/documentation/FSKit/FSItem/Attributes) or throw an error.

## Discussion

For file systems that don’t support hard links, set [`linkCount`](/documentation/FSKit/FSItem/Attributes/linkCount) to `1` for regular files and symbolic links.

If the item’s `bsdFlags` contain the `UF_COMPRESSED` flag, your file system returns the uncompressed size of the file.

---

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)