Contents

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 -> FSVolumeRenameResult

Parameters

  • 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 nil error. If renaming fails, pass the relevant error as the second parameter; FSKit ignores the Fsvolumerenameresult instance in this case. For an async Swift implementation, there’s no reply handler; simply return the result instance or throw an error.

See Also

Renaming the volume