<!--
{
  "availability" : [
    "macOS: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/SetXattrPolicy",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:@E@FSSetXattrPolicy"
  },
  "title" : "FSVolume.SetXattrPolicy"
}
-->

# FSVolume.SetXattrPolicy

Flags to specify the policy when setting extended file attributes.

```
enum SetXattrPolicy
```

## Topics

### Declaring a policy

[`FSVolume.SetXattrPolicy.alwaysSet`](/documentation/FSKit/FSVolume/SetXattrPolicy/alwaysSet)

Set the value, regardless of previous state.

[`FSVolume.SetXattrPolicy.mustCreate`](/documentation/FSKit/FSVolume/SetXattrPolicy/mustCreate)

Set the value, but fail if the extended attribute already exists.

[`FSVolume.SetXattrPolicy.mustReplace`](/documentation/FSKit/FSVolume/SetXattrPolicy/mustReplace)

Set the value, but fail if the extended attribute doesn’t already exist.

[`FSVolume.SetXattrPolicy.delete`](/documentation/FSKit/FSVolume/SetXattrPolicy/delete)

Delete the value, failing if the extended attribute doesn’t exist.



---

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)