3000
3050 DEFFNdisk(addr%,cmd%,drv%,trk%,sec%,num%,den%):LOCALfs%
3060 fs%=FNfs:IFfs%<>4:*FX143,18,4
3070 REPEATX%?0=drv%+den%*24+8:X%!1=addr%:X%?5=3-7*(cmd%>127)
3080 X%?6=cmd%:X%?7=trk%:X%?8=sec%:X%?9=num%OR&20:A%=127:CALL&FFF1
3090 A%=X%?(7+X%?5):UNTILA%<>&10:IFfs%<>4:OSCLI"FX143,18,"+STR$fs%
3100 =A%
3110 DEFFNscsi(addr%,cmd%,drv%,sect%,num%):LOCALfs%
3120 fs%=FNfs:IFfs%<>8:*FX143,18,8
3130 X%?0=0:X%!1=addr%:X%?5=cmd%:X%?6=drv%*32+((sect%AND&1F0000)DIV65536)
3140 X%?7=((sect%AND&FF00)DIV256):X%?8=sect%:X%!9=num%:X%!11=0
3150 A%=&72:CALL&FFF1:A%=?X%:IFfs%<>8:OSCLI"FX143,18,"+STR$fs%
3160 =A%
3170 DEFFNfx(A%,X%):LOCALY%:Y%=X%DIV256:=((USR&FFF4)AND&FFFF00)DIV256
3180 DEFFNh0(A%,N%):=RIGHT$("0000000"+STR$~A%,N%)
3190 DEFFNd0(A%,N%):=RIGHT$("00000000"+STR$A%,N%)
3200 DEFFNs(A$):IFLEFT$(A$,1)=" ":REPEATA$=MID$(A$,2):UNTILLEFT$(A$,1)<>" "
3210 IFRIGHT$(A$,1)=" ":REPEATA$=LEFT$(A$,LENA$-1):UNTILRIGHT$(A$,1)<>" "
3220 =A$
3230 DEFFNuc(A$):LOCALB$:IFA$="":=""
3240 REPEATB$=B$+CHR$(ASCA$AND((A$<"@")OR&DF)):A$=MID$(A$,2):UNTILA$="":=B$
3250 DEFFNfile(A$,A%):IFA%-8:IFPAGE<&FFFFF:$name%=A$:?X%=name%:X%?1=name%DIV256:=(USR&FFDD)AND&FF
3260 A$=FNf_name(A$):IFA%=255ORA%=5:X%!14=OPENIN(A$):IFX%!14:X%!10=EXT#X%!14:CLOSE#X%!14:X%!14=&33
3270 IFA%=255:IFX%?6=0:OSCLI"LOAD """+A$+""" "+STR$~X%!2:=1
3280 IFA%=5:IFX%!14:=1ELSEIFA%=5:=0
3290 IFA%=0:OSCLI"SAVE """+A$+""" "+STR$~X%!10+" "+STR$~X%!14:X%!10=X%!14-X%!10:=1
3300 IFA%=7:OSCLI"SAVE """+A$+""" "+STR$~PAGE+"+"+STR$~X%!10:X%!10=X%!14-X%!10:=1
3310 IFA%-8:=0
3320 IF(os%AND-24):A$="mkdir "+A$ELSEA$="cdir "+A$
3330 IFHIMEM>&FFFF:LOCALERROR:ONERRORLOCAL:=0
3340 OSCLIA$:=2
3350 DEFPROCgbpb(A%,chn%,addr%,num%,ptr%)
3360 ?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:IFPAGE<&FFFFF:CALL&FFD1:ENDPROC
3370 IFA%=1ORA%=3:PTR#?X%=X%!9
3380 REPEAT:IFA%=1ORA%=2:BPUT#?X%,?X%!1ELSEIFA%=3ORA%=4:?X%!1=BGET#?X%
3390 X%!1=X%!1+1:X%!5=X%!5-1:UNTIL(EOF#?X%ANDA%>2)ORX%!5<1:ENDPROC
3400 DEFFNfs:IF(os%AND-32)=0:LOCALA%,Y%,E%:=(USR&FFDA)AND&FF
3410 =29
3420 DEFFNf_openin(A$)=OPENIN(FNf_name(A$))
3430 DEFFNf_openout(A$)=OPENOUT(FNf_name(A$))
3440 DEFFNf_name(A$):IFos%AND-32:LOCALA%,B%:REPEATB%=A%:A%=INSTR(A$,"\",A%+1):UNTILA%=0:IFINSTR(A$,".",B%)=0:A$=A$+"."
3450 =A$
3460 DEFFNNetFS_Op(A%,A$)=FNNetFS_OpN(A%,0,7,A$)
3470 DEFFNNetFS_OpN(A%,T%,O%,A$):LOCALN%:!X%=0:X%?1=O%+1+LENA$:X%!3=A%:X%?7=T%:$(X%+O%)=A$
3480 IFHIMEM>&FFFF:FORN%=4TOX%?1:X%?N%=X%?(N%+3):NEXT:SYS&60048,A%,X%+4,O%+LENA$,120TOA%:IFA%=0:X%?3=0:=0
3490 IFHIMEM>&FFFF:IFA%>&FFFF:X%?3=?A%:SYS&2002B,A%+4TO$(X%+4):=X%?3
3500 A%=&14:CALL&FFF1:=X%?3