$ save_ver = 'f$verify(0)' $ stat = 3 $ why = "" $ on warning then goto LEAVE $ on control_y then goto LEAVE $! $ thedisk = p1 $ fullcheck = p2 .nes. "" $ DC$_DISK = 1 $ UCB$M_TEMPLATE = %x2000 $ mypid = f$getjpi("", "PID") $ ownerpid = mypid $! $! ---- to be accessible, the device must "exist", be "mounted", $! ---- be "available", and the cpu to which it belongs must be $! ---- up and running $! $! ---- it cannot be allocated by another process $! $ if thedisk .eqs. "" $ then $ why = "no device named" $ goto LEAVE $ endif $ if .not. f$getdvi(thedisk, "EXISTS") $ then $ why = "does not exist" $ goto LEAVE $ endif $! $ if why .eqs. "" .and. .not. f$getdvi(thedisk, "HOST_AVAIL") then why = "host unavailable" $ if why .eqs. "" .and. f$getdvi(thedisk, "DEVCLASS") .ne. DC$_DISK then why = "not a disk" $ if why .eqs. "" .and. (f$getdvi(thedisk, "STS") .and. UCB$M_TEMPLATE) .ne. 0 then why = "template" $ if why .eqs. "" .and. .not. f$getdvi(thedisk, "MNT") then why = "not mounted" $ if why .eqs. "" .and. .not. f$getdvi(thedisk, "AVL") then why = "not available" $ if why .eqs. "" .and. fullcheck .and. f$getdvi(thedisk, "DMT") then why = "marked for dismounting" $ if why .eqs. "" .and. fullcheck .and. f$getdvi(thedisk, "FOR") then why = "foreign device" $ if why .eqs. "" .and. fullcheck .and. f$getdvi(thedisk, "SWL") then why = "software write locked" $ if why .eqs. "" .and. fullcheck then ownerpid = f$getdvi(thedisk, "PID") $ if why .eqs. "" .and. fullcheck .and. f$getdvi(thedisk, "ALL") .and. ownerpid .nes. mypid then why = "allocated" $! $ LEAVE: $ if why .eqs. "" then stat = 1 $ if p3 .nes. "" $ then $ 'p3' == why $ endif $ exit 'stat' + 0 * f$verify(save_ver)