10
20 ONERRORREPORT:PROCClose_All:PRINT" at line ";ERL:PROCexit(ERR)
30 in$=FNOS_GetEnv:DIMctrl% 31,info% 127,extra% 127,zp% 11:X%=ctrl%:Y%=X%DIV256:wr%=2:rd%=4
40 IFin$="":INPUT"File to examine: "in$
50 IFLEFT$(in$,2)="-?":PRINT"ZipInfo <filename>":PROCexit(0)
60 IFASCin$<>45:A%=INSTR(in$,":",3):IFA%:in$="-"+LEFT$(in$,A%-1)+"-"+MID$(in$,A%+1)
70 in%=OPENIN(in$):IFin%=0:PRINT"File '"in$"' not found":PROCexit(214)
80 PROCgbpb(rd%,in%,zp%,4,0):IF!zp%<>&04034B50:PRINT"Not a ZIP file":CLOSE#in%:in%=0:PROCexit(-1)
90 PRINT"Name"SPC11"Sys Ver Flag Type ModTime ModDate CRC CompSize FileSize"
100 PTR#in%=0:REPEAT:PROCgbpb(rd%,in%,zp%,4,0):id%=!zp%:done%=FALSE
110 IF(id%AND&FFFF)=&4B50OREOF#in%:done%=TRUE
120 IFid%=&04034B50:PROCfile
130 IFNOTdone%:PTR#in%=PTR#in%-3:PRINT"Damaged ZIP?";CHR$13;
140 UNTILid%=&06054B50ORid%=&02014B50OREOF#in%
150 CLOSE#in%:in%=0:PROCexit(0):END
160 DEFPROCfile
170 PROCgbpb(rd%,in%,info%,26,0):nameln%=FNex16(22):extln%=FNex16(24)
180 len%=nameln%:IFlen%>127:len%=127:ptr%=PTR#in%
190 IFlen%:PROCgbpb(rd%,in%,extra%,len%,0):IFlen%=127:PTR#in%=ptr%+nameln%
200 extra%?len%=13:name$=$extra%:FORA%=0TO127STEP4:extra%!A%=0:NEXT
210 len%=extln%:IFlen%>127:len%=127
220 ptr%=PTR#in%:IFlen%:PROCgbpb(rd%,in%,extra%,len%,0)
230 PTR#in%=ptr%+extln%+info%!14
240 name$=FNfn_zip(name$):PRINTname$;TAB(14);
250 IF(info%?2AND8):!zp%=0:REPEAT:!zp%=zp%!1:zp%?3=BGET#in%:UNTIL!zp%=&08074B50OREOF#in%:PROCgbpb(rd%,in%,info%+10,12,0)
260 PRINTFNhost(info%?0)" ";~info%?1DIV16;".";~info%?1AND15;" "FNh0(info%!2,4)" "FNh0(info%!4,4)" ";
270 PRINTFNprtime(FNfstime(info%!6))" "FNprdate(FNfsdate(info%!8))" ";
280 PRINTFNh0(info%!10,8)" "FNh0(info%!14,8)" "FNh0(info%!18,8)
290 IFextln%=0:ENDPROC
300 IF(!extra%AND&FFFF)<>&4341:PRINTSPC7;"Ex: ";extln%;": ";:FORA%=0TOextln%-1STEP4:PRINTFNh0(extra%!A%,8)" ";:NEXT:PRINT:ENDPROC
310 IF(!extra%AND&FFFF)<>&4341:ENDPROC
320 dsz%=extra%?2:IFdsz%<13:PRINTSPC16;ELSEPRINTFNf_access(extra%?16,0);SPC7;
330 PRINTFNh0(extra%!8,8)" "FNh0(extra%!12,8);
340 IFdsz%>14:PRINT" "FNprdate(extra%!17);
350 IFdsz%>25:PRINT" "FNprtime(FNfstime(extra%!24));
360 IFdsz%>27:PRINT" "FNprdate(FNfsdate(extra%!26));
370 IFdsz%>29:PRINT" "FNh0(extra%!28,4);
380 IFdsz%>31:PRINT" ("FNh0(extra%!30,4);")";
390 PRINT:ENDPROC
400 DEFFNex16(A%)=info%!A%AND&FFFF
410 DEFFNhost(A%):IFA%<11:=MID$(" FAT Ami VMS Unx CMS Atr OS2 MacZSys CPMNTFS",A%*4+1,4)ELSE=" "+FNh0(A%,2)+" "
420 DEFFNfsdate(A%):A%=A%-&200:=(A%AND31)+((A%AND&1E0)*8)+((A%AND&1E00)*8)+((A%AND&E000)DIV256)
430 DEFFNfstime(A%):=((A%AND&F800)DIV2048)+((A%AND&7E0)*8)+((A%AND31)*131072)
440 DEFFNprdate(A%)=FNd0(A%AND31,2)+"/"+FNd0((A%AND&F00)DIV256,2)+"/"+STR$(1981+((A%AND&F000)DIV4096)+(A%AND&E0)DIV2)
450 DEFFNprtime(A%)=FNd0(A%AND63,2)+":"+FNd0((A%AND&3F00)DIV256,2)+":"+FNd0((A%AND&3F0000)DIV65536,2)
460 DEFFNfn_zip(B$):LOCALB%:A$="#?./$<^>&+@=%; "
470 FORA%=1TOLENB$:B%=INSTR(A$,MID$(B$,A%,1))-1
480 IFB%>TRUE:B$=LEFT$(B$,A%-1)+MID$(A$+"_",(B%EOR1)+1,1)+MID$(B$,A%+1)
490 NEXT:=B$
500 DEFPROCClose_All
510 in%=in%:IFin%:A%=in%:in%=0:CLOSE#A%
520 out%=out%:IFout%:A%=out%:out%=0:CLOSE#A%
530 ENDPROC
540 DEFFNh0(A%,N%):=RIGHT$("0000000"+STR$~A%,N%)
550 DEFFNd0(A%,N%):=RIGHT$("00000000"+STR$A%,N%)
560 DEFFNf_access(A%,T%):LOCALA$:IF(A%AND128):A$="P"
570 IF(T%AND2):A$=A$+"D"
580 IF(A%AND8):A$=A$+"L"
590 IF(A%AND2):A$=A$+"W"
600 IF(A%AND1):A$=A$+"R"
610 IF(A%AND5)=4:A$=A$+"E"
620 A$=A$+"/":IF(A%AND32):A$=A$+"w"
630 IF(A%AND16):A$=A$+"r"
640 IF(A%AND80)=64:A$=A$+"e"
650 =LEFT$(A$+" ",8)
660 DEFPROCgbpb(A%,chn%,addr%,num%,ptr%):?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:CALL&FFD1:ENDPROC
670 DEFFNOS_GetEnv:A%=0:X%=1:os%=((USR&FFF4)AND&FF00)DIV256
680 A%=&600-&7B00*(PAGE>&8000):IF!(PAGE-&100)=@%:A%=PAGE-&300
690 IF?(TOP-3)=0:A%=&100:IFHIMEM<&FFFF:A%=PAGE-&300:IF!(HIMEM+512)=@%:A%=HIMEM
700 A$=$A%:IFPAGE=&8F00:run$=A$:SYS16TOA$,,A%:SYS72,"",A%:A$=MID$(A$,1+INSTR(A$+" "," ",1+INSTR(A$," "))):IFLENA$=0:A$=run$
710 FORY%=-1TO0:A$=" "+A$:REPEATA$=MID$(A$,2):UNTILASCA$<>32:IFASCA$=34:A%=INSTR(A$,"""",2)+1ELSEA%=INSTR(A$+" "," ")
720 IFY%:run$=MID$(A$,1-(ASCA$=34),A%-1+2*(ASCA$=34)):A$=MID$(A$,A%+1)
730 NEXT:=A$
740 DEFPROCos(A$):IFASCA$=42:OSCLIA$ELSEIFLENA$:CHAINA$
750 ENDPROC
760 DEFPROCexit(A%):OSCLI"FX1,"+STR$A%:quit$=quit$:A$=quit$:quit$="":PROCos(A$)
770 IFPAGE>&FFFFF:QUITA%ELSEEND
780 ENDPROC
65453 OSCLIIPAGEWHENPLOTPAGEELLIPSELENRECTANGLEERRORLEN41147 ORINTPOSPROCATN