Platforms to show: All Mac Windows Linux Cross-Platform

MacUnmountVolumeMBS(volume as folderItem, Force as Boolean, byref dissenter as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method System MBS MacOSX Plugin 16.1 ✅ Yes ❌ No ❌ No ✅ Yes All
This routine unmounts the volume specified by FolderItem.
Example
dim u as Integer = VolumeCount-1
for i as Integer = 0 to u
dim v as FolderItem = volume(i)

if v.Name = "TestServer" then
dim dissenter as Integer = 0
dim e as Integer = MacUnmountVolumeMBS(v, false, dissenter)

if e = 0 then
MsgBox "Unmounted"
else
MsgBox "Failed to unmount with error "+str(e)+". The app with PID "+str(dissenter)+" blocks it."
end if
end if
next

If the volume cannot be unmounted the pid of the process which denied the unmount will be returned in the dissenter parameter. This routine returns after the unmount is complete.

Force: Specify true if you want the volume forcibly unmounted. Force unmounting a volume will very likely result in data loss since the volume will be ejected even if there are open files on it. This option should be reserved for situations such as the backing store for a volume is gone (so the data is lost regardless).

dissenter: pid of the process which denied the unmount if the unmount is denied.

Returns Mac OS X error code. Zero for success.

Blog Entries

The items on this page are in the following plugins: MBS MacOSX Plugin.


The biggest plugin in space...