by Whittier College. Whittier College supplies no equipment. & ! & !***************************************************************& ! 12 ! & ! This program was written for internal use and has not & !been significantly modified for export. You may need to make & !changes to fit your system or needs. If you have any problems & !please contact: & ! & ! David Garland & ! Whittier College & ! Whittier CA 90601 & ! (213) 693-0771 ext 289 & ! 20 ! & ! PROBIT & ! & !A program to set the protect bit on files. When this bit is & !set the file can be neither deleted not renamed. & ! & !This program is similar to the one called UFD. Look to that & !program for a description of the UFD. & ! 100 ! & !Get the account number & ! 110 PRINT "Account number"; \ & INPUTLINE PPN$ \ & PPN$ = CVT$$(PPN$,-1%) 120 IF PPN$ = "" THEN GOTO 900 130 BRACKET% = INSTR(1%,PPN$,"(") \ & IF BRACKET% = 0% & THEN PPN$ = "[" + PPN$ + "]" 200 ! & !get name of file & ! 210 INPUT "File name"; FILE$ 220 IF FILE$ = "" THEN GOTO 100 300 ! & !starting disk & ! 310 DISK$ = "DR0:" 400 ! & !open up and dimension the UFD; get cluster size & ! 410 OPEN DISK$ + PPN$ FOR INPUT AS FILE #1%, MODE 16384% 420 DIM #1%, U%(3583%,7%) & !up to 3584 blockettes of 8 words each 430 CLU% = U%(31%,0%) 500 ! & !look through name blockettes for it and process & ! 510 PTR% = FNLINK%(U%(0%,0%)) & !first word of first blockette is a link to first NB 520 IF PTR% = 0% THEN GOTO 600 !a zero pointer is end of NB's 530 TFILE$ = RAD$(U%(PTR%,1%)) + RAD$(U%(PTR%,2%)) + "." & + RAD$(U%(PTR%,3%)) 540 TFILE$ = CVT$$(TFILE$,2%) 550 IF TFILE$ = FILE$ & THEN GOSUB 2000 \ & GOTO 200 560 PTR% = FNLINK%(U%(PTR%,0%)) !get link to next NB 570 GOTO 520 600 ! & !couldn't find the file on DR0: & ! 610 IF DISK$ = "DR0:" & THEN DISK$ = "DR6:" \ & GOTO 400 900 ! & !done & ! 910 CLOSE #1% 920 GOTO 32767 2000 ! & ! & ! SUBROUTINE: Do a single file & ! & ! 2100 ! & !find the status byte and protect bit & ! 2110 FSTATUS% = U%(PTR%,4%) AND 255% 2120 PROBIT% = (FSTATUS% AND 32%) / 32% 2200 ! & !say what is now true & ! 2210 IF PROBIT% = 0% & THEN PRINT "Protect bit is off." & ELSE PRINT "Protect bit is on." 2300 ! & !ask about new status & ! 2310 INPUT "New status of protect bit (ON, OFF)"; BIT$ \ & BIT$ = CVT$$(BIT$,-1%) 2320 IF BIT$ = "" THEN RETURN 2330 IF BIT$ <> "ON" AND BIT$ <> "OFF" & THEN PRINT "Please specify." \ & GOTO 2310 2400 ! & !do it & ! 2410 IF BIT$ = "ON" AND PROBIT% = 0% & THEN U%(PTR%,4%) = U%(PTR%,4%) OR 32% 2420 IF BIT$ = "OFF" AND PROBIT% = 1% & THEN U%(PTR%,4%) = U%(PTR%,4%) AND (NOT 32%) 2990 RETURN 8000 ! & ! & ! FUNCTIONS & ! & ! 8010 ! & !convert link word to Blockette number & ! & !bits 9 to 11 are the cluster number. The first line gets & ! these bits and multiplies by cluster size & !bits 12 to 15 are block number. The next line gets these and & ! multiplies by 32 (number of blockettes per block) & !bits 4 to 8 are the blockette number. The last line adds & ! this. & !the other bits of the link are not relevant here & ! 8020 DEF FNLINK%(L%) = & ((( L% AND 3584%) / 512% ) * CLU% & + ( SWAP%( L% AND -4096% ) / 16% )) * 32% & + (( L% AND 496%) / 16%) 32767 END PROBITBAS[.050021]PROBIT.BAS[.050021]   X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>