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

# setVolumeName(_:replyHandler:)

Sets a new name for the volume.

```
func setVolumeName(_ name: FSFileName, replyHandler reply: @escaping @Sendable (FSFileName?, (any Error)?) -> Void)
```

## Parameters

`name`

The new volume name.

`reply`

A block or closure to indicate success or failure. If renaming succeeds, pass an [`FSFileName`](/documentation/FSKit/FSFileName) of the new volume name and a `nil` error. If renaming fails, pass the relevant error as the second parameter; FSKit ignores any [`FSFileName`](/documentation/FSKit/FSFileName) in this case. For an `async` Swift implementation, there’s no reply handler; simply return the [`FSFileName`](/documentation/FSKit/FSFileName) 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)