$ save_ver = 'f$verify(0)' $ on warning then goto LEAVE $ on control_y then goto LEAVE $! $ if p1 .eqs. "" then exit 3 $ 'p1' == "" $ first = 1 $ mypid = f$getjpi("", "PID") $! $ canscan = 0 $ set noon $ define /user sys$error nl: $ define /user sys$output nl: $ if f$device() then index = 0 $ if $status then canscan = 1 $ set on $ if canscan $ then $ listfs = "" $ else $ listfs = "SYS$LOGIN:DDD_" + mypid + ".TMP" $ show devices d /output='listfs' $ open /read listchan 'listfs' $ read listchan listrec $ read listchan listrec $ read listchan listrec $ endif $! $ LOOP: $ if listfs .nes. "" $ then $ read /end=LEAVE listchan listrec $ curdisk = f$element(0, " ", listrec) $ else $ curdisk = f$device(, "DISK") $ endif $ if curdisk .eqs. "" then goto LEAVE $! $! ---- to be accessible, the device must "exist", be "mounted", $! ---- be "available", and the cpu to which it belongs must be $! ---- up and running $! $ if .not. f$getdvi(curdisk, "EXISTS") then goto LOOP $ if .not. f$getdvi(curdisk, "HOST_AVAIL") then goto LOOP $ if .not. f$getdvi(curdisk, "MNT") then goto LOOP $ if .not. f$getdvi(curdisk, "AVL") then goto LOOP $! $! ---- it cannot be "marked for dismounting", "foreign", or $! ---- "software write locked" $! $ if f$getdvi(curdisk, "DMT") then goto LOOP $ if f$getdvi(curdisk, "FOR") then goto LOOP $ if f$getdvi(curdisk, "SWL") then goto LOOP $! $! ---- it cannot be allocated by another process $! $ if f$getdvi(curdisk, "ALL") $ then $ ownerpid = f$getdvi(curdisk, "PID") $ if ownerpid .nes. mypid then goto LOOP $ endif $! $ if .not. first then 'p1' == 'p1' + "," $ 'p1' == 'p1' + curdisk $ first = 0 $! $ goto LOOP $! $ LEAVE: $ if listfs .nes. "" $ then $ close listchan $ delete /nolog 'listfs';* $ endif $ exit 1 + 0 * f$verify(save_ver)