setVolumeName(_:context:replyHandler:)
Sets a new name for the volume.
Declaration
func setVolumeName(_ name: FSFileName, context: FSContext, replyHandler reply: @escaping @Sendable (FSVolumeRenameResult?, (any Error)?) -> Void)func setVolumeName(_ name: FSFileName, context: FSContext) async throws -> FSVolumeRenameResultParameters
- name:
The new volume name.
- context:
An object that enables context-aware file system decisions throughout the operation.
- reply:
A block or closure to indicate success or failure. If renaming succeeds, pass an instance of Fsvolumerenameresult containing the Fsfilename of the new volume name, along with a
nilerror. If renaming fails, pass the relevant error as the second parameter; FSKit ignores the Fsvolumerenameresult instance in this case. For anasyncSwift implementation, there’s no reply handler; simply return the result instance or throw an error.