unmountVolume(at:options:completionHandler:)
Starts the process of unmounting the specified volume.
Declaration
func unmountVolume(at url: URL, options mask: FileManager.UnmountOptions = [], completionHandler: @escaping @Sendable ((any Error)?) -> Void)func unmountVolume(at url: URL, options mask: FileManager.UnmountOptions = []) async throwsParameters
- url:
A file URL specifying the volume to be unmounted.
- mask:
A bitmask of Unmountoptions that you can use to customize the unmount operation’s behavior.
- completionHandler:
A block executed when the unmount operation completes. The block receives an error parameter which is
nilif unmounting was successful. Otherwise, it indicates why unmounting failed.
Discussion
If the volume is encrypted, it is relocked after being unmounted.