Platforms to show: All Mac Windows Linux Cross-Platform
Back to FolderItem class.
FolderItem.EjectVolumeMBS(force as boolean, byref dissenterPID as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Files | MBS MacClassic Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If the volume cannot be ejected the pid of the process which denied the unmount will be returned in the dissenter parameter. This routine returns after the eject is complete. Ejecting a volume will result in the unmounting of other volumes on the same device.
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).
dissenterPID: Optionally, pid of the process which denied the unmount if the unmount is denied.
Returns a Mac OS error code. 0 means no error and -1 is a plugin error if the function can't be called. -47 is returned if the disc is in use.
PS: Seems like on my tests the pid is not set by Apple.
Blog Entries
The items on this page are in the following plugins: MBS MacClassic Plugin.