! ----- READ_ALL_RIGHTSLIST_SPECS.FUN ----- ! ! ----- SUBROUTINE TO READ IN ALL RIGHTSLIST FILE SPECS ----- ! ----- AND OPEN RIGHTSLIST FILES ----- ! ! ---------- RETURNED: ---------- ! ! ----- RIGHTSLIST_COUNTER = Count of RIGHTSLIST.DAT files ! ----- RIGHTSLIST_SPECS() = List of RIGHTSLIST.DAT files (blank ! ----- if not accessible) ! ----- RIGHTSLIST_NODES() = List of RIGHTSLIST.DAT nodes ! ----- (without any ::) ! ! ----- Last Change 02/17/94 by Brian Lomasky ----- ! SUB READ_ALL_RIGHTSLIST_SPECS %INCLUDE "NUSER.INC" DECLARE WORD ERR_FLAG ! LOCAL ERROR FLAG DECLARE WORD I_O_CHNL ! RIGHTSLIST I/O CHNL TO ACCESS DECLARE STRING TEMP_STRING ! TEMPORARY STRING EXTERNAL WORD FUNCTION & DISK_UNAVAILABLE(STRING)! TRUE IF DISK UNAVAILABLE IF DEBUG_MODE THEN PRINT "DEBUG>Call READ_ALL_RIGHTSLIST_SPECS" END IF ERR_FLAG = FALSE ! INIT ERROR FLAG WHEN ERROR IN OPEN "TOOLS:RIGHTSLIST_SPECS.DAT" FOR INPUT & AS FILE #99%, SEQUENTIAL, ACCESS READ, & ALLOW READ, RECORDTYPE ANY USE IF ERR = FILE_NOT_FOUND THEN PRINT "Error - Can't find any existing" & + " TOOLS:RIGHTSLIST_SPECS.DAT" & + " file" + BEL ERR_FLAG = TRUE CONTINUE END IF IF ERR = PROTECTION_VIOLATION THEN PRINT "You do not have the privilege" + & " to open" + & " TOOLS:RIGHTSLIST_SPECS.DAT file" + BEL ERR_FLAG = TRUE CONTINUE END IF IF ERR = CANNOT_OPEN_FILE THEN PRINT "Error - Can't open any existing" & + " TOOLS:RIGHTSLIST_SPECS.DAT" & + " file" + BEL PRINT "VMS error status value:"; VMSSTATUS ERR_FLAG = TRUE CONTINUE END IF PRINT "VMS error status value:"; VMSSTATUS EXIT HANDLER END WHEN CALL SYS$EXIT(ERROR_WITH_NO_PUTMSG BY VALUE) IF ERR_FLAG RIGHTSLIST_COUNTER = 0% WHILE NOT ERR_FLAG WHEN ERROR IN LINPUT #99%, TEMP_STRING USE IF ERR = END_OF_FILE THEN ERR_FLAG = TRUE CONTINUE END IF PRINT PRINT "Unexpected BASIC Error " + & NUM1$(ERR) + & " while reading" + & " TOOLS:RIGHTSLIST_SPECS.DAT" + BEL PRINT "VMS error status value:"; VMSSTATUS EXIT HANDLER END WHEN IF NOT ERR_FLAG THEN RIGHTSLIST_COUNTER = RIGHTSLIST_COUNTER + 1% RIGHTSLIST_SPECS(RIGHTSLIST_COUNTER) = & TEMP_STRING ! ----- EXTRACT NODE ----- TEMP_STRING = LEFT(TEMP_STRING, & POS(TEMP_STRING, ":", 1%) - 1%) TEMP_STRING = RIGHT(TEMP_STRING, 6%) & IF LEFT(TEMP_STRING, 5%) = "DISK$" RIGHTSLIST_NODES(RIGHTSLIST_COUNTER) = & TEMP_STRING IF DEBUG_MODE THEN PRINT "DEBUG> Found Rightslist"& + " #" + NUM1$( & RIGHTSLIST_COUNTER) + & " for node " + TEMP_STRING END IF END IF NEXT ERR_FLAG = FALSE ! INIT ERROR FLAG CLOSE #99% IF RIGHTSLIST_COUNTER = 0% THEN PRINT PRINT "Error - No file specs found in" + & " TOOLS:RIGHTSLIST_SPECS.DAT" + BEL CALL SYS$EXIT(ERROR_WITH_NO_PUTMSG BY VALUE) END IF ! ----- OPEN EACH OF THE RIGHTSLIST FILES ----- I_O_CHNL = 0% ! INIT I/O CHANNEL COUNTER WHILE I_O_CHNL < RIGHTSLIST_COUNTER I_O_CHNL = I_O_CHNL + 1% TEMP_STRING = TRM$(RIGHTSLIST_SPECS(I_O_CHNL)) ! ----- SKIP IF RIGHTSLIST UNAVAILABLE ----- ITERATE IF TEMP_STRING = "" IF DISK_UNAVAILABLE(TEMP_STRING) THEN ! ----- EXTRACT NODE NAME ----- TEMP_STRING = TRM$(RIGHTSLIST_SPECS(I_O_CHNL)) TEMP_STRING = LEFT(TEMP_STRING, & POS(TEMP_STRING, ":", 1%) - 1%) TEMP_STRING = RIGHT(TEMP_STRING, 6%) & IF LEFT(TEMP_STRING, 5%) = "DISK$" PRINT "Warning: Rightslist on node " + & TEMP_STRING + " is unavailable" + BEL RIGHTSLIST_SPECS(I_O_CHNL) = "" ITERATE END IF TEMP_STRING = TRM$(RIGHTSLIST_SPECS(I_O_CHNL)) WHEN ERROR IN OPEN TEMP_STRING FOR INPUT & AS FILE #I_O_CHNL, & RECORDSIZE 64%, & ACCESS MODIFY, & ALLOW MODIFY, & INDEXED VARIABLE, & MAP RIGHTZ, & RECORDTYPE ANY USE IF ERR = ILLEGAL_USAGE_FOR_DEVICE THEN ! ----- EXTRACT NODE NAME ----- TEMP_STRING = TRM$( & RIGHTSLIST_SPECS(I_O_CHNL)) TEMP_STRING = LEFT(TEMP_STRING, & POS(TEMP_STRING, ":", 1%) - 1%) TEMP_STRING = & RIGHT(TEMP_STRING, 6%) & IF LEFT(TEMP_STRING, 5%)& = "DISK$" PRINT "Warning: Rightslist" + & " on node " + & TEMP_STRING + & " is unavailable" + BEL ! ----- MARK RIGHTSLIST AS ----- ! ----- "UNAVAILABLE" ----- RIGHTSLIST_SPECS(I_O_CHNL) = "" TEMP_STRING = "" CONTINUE END IF IF ERR = FILE_NOT_FOUND THEN PRINT "Error - Can't find " + & TEMP_STRING + BEL ERR_FLAG = TRUE CONTINUE END IF IF ERR = PROTECTION_VIOLATION THEN PRINT "You do not have the" + & " privilege to open " + & TEMP_STRING + BEL ERR_FLAG = TRUE CONTINUE END IF IF ERR = CANNOT_OPEN_FILE THEN PRINT "Error - Can't open " + & TEMP_STRING + BEL PRINT "VMS error status value:";& VMSSTATUS ERR_FLAG = TRUE CONTINUE END IF PRINT "VMS error status value:"; VMSSTATUS EXIT HANDLER END WHEN NEXT CALL SYS$EXIT(ERROR_WITH_NO_PUTMSG BY VALUE) IF ERR_FLAG ! ----- ENSURE THAT THERE IS AN AVAILABLE RIGHTSLIST FILE ----- IF TRM$(RIGHTSLIST_SPECS(1%)) = "" THEN PRINT PRINT "Error - Local node's RIGHTLIST.DAT" + & " file not found" + BEL PRINT " Aborting..." CALL SYS$EXIT(ERROR_WITH_NO_PUTMSG BY VALUE) END IF I_O_CHNL = 0% ! INIT I/O CHANNEL COUNTER ERR_FLAG = TRUE ! ASSUME ERROR STATUS WHILE I_O_CHNL < RIGHTSLIST_COUNTER AND ERR_FLAG I_O_CHNL = I_O_CHNL + 1% ! ----- SKIP IF RIGHTSLIST UNAVAILABLE ----- ITERATE IF TRM$(RIGHTSLIST_SPECS(I_O_CHNL)) = "" ERR_FLAG = FALSE ! SET TO EXIT LOOP NEXT IF ERR_FLAG THEN PRINT PRINT "Error - No available RIGHTLIST.DAT" + & " file found" + BEL PRINT " Aborting..." CALL SYS$EXIT(ERROR_WITH_NO_PUTMSG BY VALUE) END IF END SUB