10
20
30
40
50
60
70
80
90
100
110
120
130
140
150 :
160 DIM ctrl% 31,name% 79:X%=ctrl%:Y%=X%DIV256
170 :
180 PRINTSPC15"Load&Save date"SPC15"FS date"
190 fs%=FNfs:PROCscan
200 END
210 :
220 DEFPROCscan:LOCAL idx%,type%,f$
230 REPEAT:f$=FNgbpb8(idx%):idx%=X%!9
240 IFf$<>"":PROCfile:IFtype%=2:OSCLI"Dir "+f$:PROCscan:OSCLI"Dir ^"
250 UNTIL f$="":ENDPROC
260 :
270 DEFPROCfile:f$="@."+f$:X%!14=0:X%!18=0:X%!22=0:type%=FNfile(f$,5)
280 ld%=X%!2:ex%=X%!6:ln%=X%!10:at%=X%!14:cdate%=X%!15:mdate%=cdate%
290 IFfs%=5:IFFNNetFS_Op(18,CHR$64+f$)=0:X%!15=X%!10:X%!17=X%!12:X%!20=X%!5:X%!22=X%!7:mdate%=X%!15
300 PROCf_date(cdate%):Cdy%=day%:Cmn%=month%:Cyr%=year%
310 PROCf_date(mdate%):Sdy%=day%:Smn%=month%:Syr%=year%
320 PROCf_time(X%!17):Sh%=hour%:Sm%=minute%:Ss%=second%
330 !X%=ex%:X%!4=ld%:PROCDate_ToOrd(X%):Lc%=centi%
340 Ldy%=day%:Lmn%=month%:Lyr%=year%:Lh%=hour%:Lm%=minute%:Ls%=second%
350 PRINTMID$(f$,3);SPC(13-LENf$);FNd(Ldy%,2)"/"FNd(Lmn%,2)"/"FNd(Lyr%,4);" ";
360 PRINTFNd(Lh%,2)":"FNd(Lm%,2)":"FNd(Ls%,2)"."FNd(Lc%,2);" ";
370 PRINTFNd(Sdy%,2)"/"FNd(Smn%,2)"/";Syr%;" ";
380 PRINTFNd(Sh%,2)":"FNd(Sm%,2)":"FNd(Ss%,2);STRING$(23,CHR$8);
390 IFCdy%+32*Cmn%+32*12*Cyr%>Sdy%+32*Smn%+32*12*Syr%:PROCModifyToCreate
400 IF(ld%AND&FFFF8000)=&FFFF0000:PRINT:ENDPROC :
410 IFLyr%<1981:PROCShortToLong:ENDPROC :
420 IFSdy%+32*Smn%+32*12*Syr%<Ldy%+32*Lmn%+32*12*Lyr%:PROCShortToLong:ENDPROC
430 IFSdy%+32*Smn%+32*12*Syr%>Ldy%+32*Lmn%+32*12*Lyr%:PROCLongToShort:ENDPROC
440 IFLs%+Lm%+Lh%+Lc%=0 :PROCShortToLong:ENDPROC
450 IFSs%+60*Sm%+60*60*Sh%<Ls%+60*Lm%+60*60*Lh% :PROCShortToLong:ENDPROC
460 IFSs%+60*Sm%+60*60*Sh%>Ls%+60*Lm%+60*60*Lh% :PROCLongToShort:ENDPROC
470 PRINT:ENDPROC
480 :
490 DEFPROCModifyToCreate:PRINT"MOD";CHR$8;CHR$8;CHR$8;
500 X%?14=at%:X%!15=mdate%:A%=FNfile(f$,4):IFfs%<>5:ENDPROC
510 X%!8=mdate%:A%=FNNetFS_OpN(19,5,10,f$):ENDPROC
520 :
530 DEFPROCShortToLong:IFtype%=2:ld%=-1:ex%=0
540 IF(ld%AND&FFF00000)<>&FFF00000:PRINT:ENDPROC :
550 IF(ld%AND&FFFF8000)=&FFFF0000:IF(ex%AND&FFFF)>=(ld%AND&FFFF):IF(ex%AND&FFFF)<(ld%AND&FFFF)+ln%:PRINT:ENDPROC :
560 IF(ld%AND&FFFFFF00)=&FFFFDD00:PRINT:ENDPROC :
570 IF((ld%+&1000)AND&FFFFC000)=&FFFF4000:PRINT:ENDPROC :
580 IF(ld%AND&FFFFF000)=&FFFF0000:IF(ex%AND&FFF00000)=0:PRINT:ENDPROC
590 IFSmn%=0 OR Sdy%=0:PRINT:ENDPROC :
600 PRINT"<--";:PROCDate_FromOrd(X%+6,Sdy%,Smn%,Syr%,Sh%,Sm%,Ss%,0)
610 X%!2=ld%:X%?2=X%?10:X%!14=at%:A%=FNfile(f$,1)
620 PRINT:ENDPROC
630 :
640 DEFPROCLongToShort:PRINT"-->";
650 X%?14=at%:A%=FNfile(f$,4):IFfs%<>5:PRINT:ENDPROC
660 X%!8=X%!20:X%!10=X%!22 :
670 X%!13=FNf_date(Ldy%,Lmn%,Lyr%) :
680 X%!15=FNf_time(Lh%,Lm%,Ls%) :
690 A%=FNNetFS_OpN(19,64,18,f$):PRINT:ENDPROC
700 :
710 DEFFNd(A%,N%)=RIGHT$("000000000"+STR$A%,N%)
720 :
730 DEFFNfile(f$,A%):$name%=f$:?X%=name%:X%?1=name%DIV256:=(USR&FFDD)AND&FF
740 DEFFNgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:CALL&FFD1:IFX%!5=1:=""
750 A%=name%+1:A%!(A%?-1)=&D20:A%?(INSTR($A%," ")-1)=13:=$A%
760 DEFFNfs:LOCALA%,Y%,E%:=(USR&FFDA)AND&FF
770 :
780 DEFPROCDate_FromOrd(mem%,d%,m%,y%,hr%,mn%,sc%,cs%):y%=y%MOD400
790 d%=y%*365.25+m%*30+d%+VALMID$("120112234455",m%,1)+((y%MOD4)=0)-((y%-1)DIV100)-(m%>2AND((y%MOD4)=0AND(y%MOD100)<>0ORy%=0))+36493
800 IFd%>146066:d%=d%-146097
810 d%=d%*&41EB:mem%!1=d%+d%:d%=((hr%*60+mn%)*60+sc%)*100+cs%
820 ?mem%=d%:mem%!1=mem%!1+d%DIV256:ENDPROC
830 :
840 DEFPROCDate_ToOrd(mem%):LOCAL A%,B%,C%,D%
850 year%=0:month%=0:day%=0:hour%=0:minute%=0:second%=0:centi%=0
860 IFmem%!1<0:ENDPROC:
870 D%=mem%!1DIV&83D6+2447065:C%=mem%?0+256*(mem%!1MOD&83D6):centi%=C%MOD100
880 C%=C%DIV100:second%=C%MOD60:C%=C%DIV60:minute%=C%MOD60:hour%=C%DIV60
890 B%=((D%*4+3)MOD146097AND-4)+3:C%=B%MOD1461DIV4*5+2:D%=D%*4+3
900 A%=C%DIV153+2:day%=C%MOD153DIV5+1:month%=A%MOD12+1
910 year%=D%DIV146097*100+B%DIV1461+A%DIV12-4800
920 ENDPROC
930 :
940 DEFFNf_date(d%,m%,y%):y%=y%-1981:=d%+m%*256+(y%AND15)*4096+(y%DIV16)*32
950 DEFFNf_time(h%,m%,s%):=h%+m%*256+s%*65536
960 :
970 DEFPROCf_date(d%):day%=d%AND31:month%=(d%AND&F00)DIV256
980 year%=(d%AND&F000)DIV4096+(d%AND&E0)/2+1981:ENDPROC
990 DEFPROCf_time(t%):hour%=t%AND255:minute%=(t%AND&FF00)DIV256
1000 second%=(t%AND&FF0000)DIV65536:ENDPROC
1010 :
1020 DEFFNNetFS_Op(A%,A$)=FNNetFS_OpN(A%,0,7,A$)
1030 DEFFNNetFS_OpN(A%,T%,O%,A$):LOCALN%
1040 IFHIMEM>&FFFF:X%?4=T%:$(X%+O%-3)=A$:SYS&60048,A%,X%+4,O%+LENA$,120TON%:IFN%=0:X%?3=0:=0
1050 IFHIMEM>&FFFF:IFN%>&FFFF:X%?3=?N%:SYS&2002B,N%+4TO$(X%+4):=X%?3
1060 !X%=0:X%?1=O%+1+LENA$:X%!3=A%:X%?7=T%:$(X%+O%)=A$:A%=&14:CALL&FFF1:=X%?3