PBEject
PBEject Eject a volume from its drive
#include <Files.h> File Manager (PBxxx)
ParmBlkPtr pb ; address of a 64-byte VolumeParam structure
returns Error Code; 0=no error
PBEject places a volume off-line (flushes it and releases its buffer
memory) then physically ejects the media from the drive.
pb is the address of a 64-byte VolumeParam structure or any of the
variants of the ParamBlockRec union that contain all the relevant
fields:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
-> ioNamePtr StringPtr 4 18 Address of volume name (or NIL)
-> ioVRefNum short 2 22 Volume reference number
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
bdNamErr (-37) Bad name
extFSErr (-58) External file system
ioErr (-36) I/O error
nsDrvErr (-56) No such drive
nsvErr (-35) No such volume
paramErr (-50) No default volume

Notes: Specify the volume with the address of its Pascal-style name in ioNamePtr
or its volume reference number in ioVRefNum. If the name is NIL or
invalid, the number is used.
The volume remains mounted; subsequent accesses of the ejected volume
will cause the File Manager to ask the user to insert the ejected disk.
If you won't need the disk again, use PBUnmountVol before calling
PBEject. You can use PBOffLine to place a volume off-line (freeing its
volume buffer), without actually ejecting the disk.