> UnZip v1.12 @ctrl%255,name%128,extra%128,zp%6:A$=OS_GetEnv:in%=0:out%=0 Iquit$=cl(" -qu",1):debug%=cl("-de",0):hlp%=cl("-?",0)::exit() (hdst$=cl("-d",1):vb%=cl("-q",0):sfe%=cl("-s",0):xtr%=cl("-X",0):inf%=cl("-255",0):in$=cl("",0) 2Cin$="-help":"BBC"s($(+7))" (C)J.G.Harston 1999-2017":hlp%= &FFFF):mem% max%:wr%=2:rd%=4 ZDin$="":"File to unzip: "in$:dst$="":"Destination path: "dst$ dBin$<>45:A%=in$,":",3):A%:in$="-"+in$,A%-1)+"-"+in$,A%+1) n:in%=(in$):in%=0:"File '"in$"' not found":exit(214) xTgbpb(rd%,in%,zp%,4,0):!zp%<>&04034B50:"Not a ZIP file":#in%:in%=0:exit(127) Efln%=10:A%=fs:sj%=((A%=5)2)+((A%=16)1)+((A%=8)8):A%=4:fln%=7 dst$:dst$=dst$+"." Edirs%=1inf%1(sj%<>0):dirs%:vb%=:inf%=0:"Finishing... "; 5#in%=0::gbpb(rd%,in%,zp%,4,0):id%=!zp%:done%= (dirs%:inf%=0:sofar(#in%,#in%); $(id%&FFFF)=&4B50#in%:done%= id%=&04034B50:file 3done%:#in%=#in%-3:"Damaged ZIP file?";13; &id%=&02014B50id%=&06054B50#in% :inf%=0:8,8,8:"Done." #in%:in%=0:exit(0): file .gbpb(rd%,in%,extra%,26,0):flags%=ex16(2) Fmethod%=ex16(4):mtime%=fstime(ex16(6)):mdate%=fsdate(ex16(8)) Fcrc%=extra%!10:csize%=extra%!14:fsize%=extra%!18:nameln%=ex16(22) ;extln%=ex16(24):nameln%:gbpb(rd%,in%,mem%,nameln%,0) "9mem%?nameln%=13:name$=$mem%:x%=01274:extra%!x%=0: ,*extln%:gbpb(rd%,in%,extra%,extln%,0) 6/hdrid%=ex16(0):dsz%=ex16(2):sig%=extra%!4 @2load%=extra%!8:exec%=extra%!12:attr%=extra%!16 J7ctime%=fstime(ex16(24)):cdate%=fsdate(ex16(26)) T?acc%=ex16(28):aux%=ex16(30):hdrid%<>&4341:dsz%=0:load%=0 ^aA$=fn_zip(name$):A%=0:B%=A$+".",".",A%+1):B%-A%>fln%+1:A$=A$,A%+fln%)+A$,B%):B%=A%+fln% h,A%=B%:B%>=A$:name$=A$:vb%:name$;" "; runzip:vb%: | ݤex16(A%)=extra%!A%&FFFF  unzip  vb%:"Type ";method%;" - "; $method%=0method%=8:unzipobj:  skip:vb%:"not supported";  unzipobj >ensurepath(dst$+name$):((name$,1)=".")dirs%)1:skip: (dst$="":name$=45:name$="@."+name$ 4name$,1)=".":name$=name$,name$-1)unzipfile Ydsz%<24:cdate%=mdate%:dsz%<22:ctime%=mtime%:dsz%<13:attr%=&33:dsz%<12:exec%=load% J(sj%1)=0:attr%=attr%-129:sj%8:attr%=attr%(-694*((attr%17)17)) fX%!14=attr%:X%!15=mdate%:dsz%:X%!2=load%:X%!6=exec%:A%=file(dst$+name$,1)A%=file(dst$+name$,4) Psj%1:dsz%>23:X%!2=acc%:X%!4=aux%:dsz%<26xtr%=0:A%=file(dst$+name$,&FD) Qsj%1:dsz%>23:X%!6=mtime%:X%!9=cdate%:X%!11=ctime%:A%=file(dst$+name$,&FC) Uxtr%:sj%1:dsz%>25:"Account "+dst$+name$+" "+~acc%+" ("+~aux%+")",dsz%>27) &(sj%2)=0: 0SX%!8=mdate%:A%=NetFS_OpN(19,5,10,dst$+name$):NetFS_OpN(18,64,8,dst$+name$): :cB%=12:X%!8=cdate%:X%!10=ctime%:X%!13=mdate%:X%!15=mtime%:A%=NetFS_OpN(19,64,18,dst$+name$): Dbxtr%:dsz%>25:A%=NetFS_OpN(0,0,7,"Account "+dst$+name$+" "+~acc%+" ("+~aux%+")",dsz%>27)) N Xunzipfile b/method%=8:os%<>6:" unsupported";:skip: l7dst$+name$>63:'"Path may be too long for NetFS" v9file(dst$+name$,5):X%!14=&33:A%=file(dst$+name$,1) _X%!10=0:X%!14=fsize%:file(dst$+name$,7)=7:X%!14=min(fsize%,&B000):A%=file(dst$+name$,0) 1(X%?142)=0:X%!14=&33:A%=file(dst$+name$,1) .out%=0:extract:(flags%8):#in%=#in%+12 vb%:8,8,8:"Done."; out%:#out%:out%=0  Bݤfstime(A%):=((A%&F800)2048)+((A%&7E0)*8)+((A%31)*131072) Rݤfsdate(A%):A%=A%-&200:=(A%31)+((A%&1E0)*8)+((A%&1E00)*8)+((A%&E000)256) $extract:fsize%=0:(vb%3);: %method%=8:vb%:"Inflating ..."; 9method%=0:out%=(dst$+name$):vb%:"Extracting ..."; .method%=8:ZipTest:out%=("") method%=8:put32(&04088B1F):put32(0):put32(&00200000):put32(&001C4341):put32(load%):put32(exec%):put32(attr%):put32(fsize%):put32(0):put32(0):put32(0) 1trans:method%=8:put32(crc%):put32(fsize%)  #out%:out%=0:method%=0: -"ZipUnCompress "+dst$+name$   *4skip:#in%=#in%+csize%+(12((flags%8)<>0)): 4%ZipTest:zipok%=zipok%:zipok%: ><*RMEnsure SparkFS 0.00 Error SparkFS needs to be running H=*RMEnsure Zip 0.00 Error SparkFS needs to load Zip module Rzipok%=: \"ensurepath(A$):A$,".")=0: fGA$=A$+".":A$=A$,A$-1):A$,1)=".":A$=A$,A$-1):file(A$,5)=2: pOB$=A$:A$="":B$:A%=B$+".","."):A$=A$+".",A$<>"")+B$,A%-1):B$=B$,A%+1) zfile(A$,5)<>2:"CDir "+A$  B$="": 1put32(A%):!zp%=A%:gbpb(wr%,out%,zp%,4,0): trans:csize%=0: 'ptr%=0::vb%:sofar(ptr%,csize%); 0len%=max%:ptr%+len%>csize%:len%=csize%-ptr% :gbpb(rd%,in%,mem%,len%,0):gbpb(wr%,out%,mem%,len%,0)  ptr%=ptr%+len%:ptr%>=csize%  ݤmin(A%,B%):A%:B$=B$,A%-1)+A$+"_",(B%1)+1,1)+B$,A%+1) V :=B$ `cݤcl(l$,n%):l$="":A$=s(A$):A$=34:A%=A$+" "" ",""" ",2):l$=A$,2,A%-2):A$=s(A$,A%+1)):=l$ j"":A%=A$,l$):A%:A$=s(A$,A%-1)+A$,A$," ",A%)+1))+" ":= ~n%=0:l$<>"":= %A%=" ",l$=32)+A$,l$):A%=0:="" 'A$=A$,A%-1)+s(A$,A$," ",A%)+1)) Cl$=32:l$=A$,A%):A$=A$,A%-1):=l$,1-(l$=34),l$+2*(l$=34)) PA$,A%,1)<>34:l$=A$,A%,A$+" "," ",A%)-A%):A$=A$,A%-1)+A$,A%+l$+1):=l$ Hl$=A$,A%+1,A$+" ",""" ",A%+1)-A%-1):A$=A$,A%-1)+A$,A%+l$+3):=l$ /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " +A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ 2ݤOS_GetEnv:A%=0:X%=1:os%=((&FFF4)&FF00)256 3A%=&600-&7B00*(>&8000):!(-&100)=@%:A%=-&300 ;?(P-3)=0:A%=&100:<&FFFF:A%=-&300:!(+512)=@%:A%= cA$=$A%:=&8F00:run$=A$:ș16A$,,A%:ș72,"",A%:A$=A$,1+A$+" "," ",1+A$," "))):A$=0:A$=run$ SY%=-10:A$=" "+A$:A$=A$,2):A$<>32:A$=34:A%=A$,"""",2)+1A%=A$+" "," ")  9Y%:run$=A$,1-(A$=34),A%-1+2*(A$=34)):A$=A$,A%+1)  :=A$ !os(A$):A$=42:A$A$:A$ ( 2@exit(A%):"FX1,"+A%:quit$=quit$:A$=quit$:quit$="":os(A$) <>&FFFFF:ȘA% F PPݤNetFS_OpN(A%,T%,O%,A$):N%:!X%=0:X%?1=O%+1+A$:X%!3=A%:X%?7=T%:$(X%+O%)=A$ ZX>&FFFF:N%=4X%?1:X%?N%=X%?(N%+3)::ș&60048,A%,X%+4,O%+A$,120A%:A%=0:X%?3=0:=0 d;>&FFFF:A%>&FFFF:X%?3=?A%:ș&2002B,A%+4$(X%+4):=X%?3 nA%=&14:&FFF1:=X%?3 I}{ O{*"ȑ " g{[{LQ%=PA.:CH."*BASIC {{{{a{a{`|{`` g{,z0ȱh`{02 ee  { {h`{{꩏ `