---
title: "setVolumeName(_:replyHandler:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsvolume/renameoperations/setvolumename(_:replyhandler:)"
---

# setVolumeName(_:replyHandler:)

Sets a new name for the volume.

## Declaration

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

```swift
func setVolumeName(_ name: FSFileName) async throws -> FSFileName
```

## Parameters

- `name`: The new volume name.
- `reply`: A block or closure to indicate success or failure. If renaming succeeds, pass an doc://FSKit/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 doc://FSKit/documentation/FSKit/FSFileName in this case. For an async Swift implementation, there’s no reply handler; simply return the doc://FSKit/documentation/FSKit/FSFileName or throw an error.
