UnmountVol
You can use the UnmountVol function to unmount a volume that isn't currently
being used.
FUNCTION UnmountVol (volName: StringPtr; vRefNum: Integer): OSErr;
volName
- A pointer to the name of a mounted volume.
vRefNum
- A volume reference number, a working directory reference number, a drive number, or 0 for the default volume.
DESCRIPTION
The UnmountVol function unmounts the specified volume. All files on the volume (except those opened by the Operating System) must be closed before you call UnmountVol, which does not eject the volume.
- WARNING
- Don't unmount the startup volume. Doing so will cause a
system crash.
RESULT CODES
| noErr | 0 | No error |
| nsvErr | -35 | No such volume |
| ioErr | -36 | I/O error |
| bdNamErr | -37 | Bad volume name |
| fBsyErr | -47 | One or more files are open |
| paramErr | -50 | No default volume |
| nsDrvErr | -56 | No such drive |
| extFSErr | -58 | External file system |