> DateFix  Fix mailing list messages . Ensures file dates matches message dates (: 2 v1.00 <. v1.01 24-May-1998 Ignores if no date set F9 v1.10 23-Jun-1998 Reads update date from fileserver PA v1.20 03-Oct-1999 Copies dates from load/exec, was SetDates Z4 v1.21 28-Aug-2000 Recurses into subdirectories dJ v1.22 15-Oct-2000 Tweeked Date header processing, uses NetFS library n, v1.23 08-Sep-2017 Updates sent headers xI v1.24 06-Sep-2018 Reads date from load/exec, sets load/exec to date > v1.25 29-Sep-2018 Copes with old-style DigiBank messages :  : : ?memmax%=--2048+2048*(>&FFFF): memmax%<1024:"No room": = ctrl% 31,data% memmax%-1:X%=ctrl%:Y%=X%256:name%=data% fs%=fs:examine  : 3examine: idx%,f$::f$=gbpb8(idx%):idx%=X%!9 9 f$<>"":file: type%=2:"Dir "+f$:examine:"Dir ^" f$="": : file "type%=file(f$,5): type%<>1:  f$;(12- f$); 1load%=X%!2:exec%=X%!6:size%=X%!10:attr%=X%?14 "0mdate%=X%!15:mtime%=0:cdate%=mdate%:ctime%=0 ,V fs%=5: NetFS_Op(18,64+f$)=0:cdate%=X%!5:ctime%=X%!7:mdate%=X%!10:mtime%=X%!12 64f_date(cdate%):Cdy%=day%:Cmn%=month%:Cyr%=year% @4f_date(mdate%):Sdy%=day%:Smn%=month%:Syr%=year% J4f_time(X%!17):Sh%=hour%:Sm%=minute%:Ss%=second% T(!X%=exec%:X%!4=load%:Date_ToOrd(X%) ^0Lh%=hour%:Lm%=minute%:Ls%=second%:Lc%=centi% h$Ldy%=day%:Lmn%=month%:Lyr%=year% r: |. Lxx = timestamp from load/exec addresses % Sxx = timestamp from attributes # Cxx = timestamp creation date : ] Smn%: Sdy%: Syr%*400+Smn%*32+Sdy%0):yr%= A$,13):h%= A$,18,2):m%= A$,21,2):s%= A$,24,2) 0* h%>24 m%>60 s%>60:h%=0:m%=0:s%=0 := dy%+mn%:Ldy%=dy%:Lmn%=mn%:Lyr%=yr%:Lh%=h%:Lm%=m%:Ls%=s% D& IF h%+m%+s%:Lh%=h%:Lm%=m%:Ls%=s% NI Lxx = timestamp from header (or header created from file timestamp) X? To do: if time=00/00/00, replace with time from datestamp b: l1 38);d0(Ldy%,2)"/"d0(Lmn%,2)"/";Lyr%;" "; v/ d0(Lh%,2)":"d0(Lm%,2)":"d0(Ls%,2)" "; SetAddrsAndDate  :  AddHeader1: ->EMail ;ptr%=mem%:to$=fetch: to$,10)=" @254":to$=fetch subj$=fetch:msg%=ptr%-mem% X to$,8)=" ->Email":to$=subj$:A$=fetch:subj$=fetch:msg%=ptr%-mem%: to$,"@")=0: AddHeader  : %AddHeader2: ->Recipient 4ptr%=mem%:to$=fetch:subj$=fetch:msg%=ptr%-mem% . to$,9)=" ->":to$=s(to$,10)) AddHeader   :  AddHeader * size%>memmax%-256: 4, subj$,9)="Subject: ":subj$=subj$,10) >edate$=d0(Ldy%,2)+" "+"000JanFebMarAprMayJunJulAugSepOctNovDecDDDEEEFFF",Lmn%*3+1,3)+" "+(Lyr%) HJ Lh%+Lm%+Ls%:date$=date$+" "+d0(Lh%,2)+":"+d0(Lm%,2)+":"+d0(Ls%,2) R&from$="J.G.Harston " \E date$,8,4)<2010:from$="J.G.Harston " fG date$,8,4)<1998:from$="J.G.Harston " p/hdr%= to$+5+ date$+7+ from$+7+ subj$+10 z' "Load "+f$+" "+~(mem%+hdr%-msg%)  ptr%=mem% store("To: "+to$) store("From: "+from$) store("Sent: "+date$) store("Subject: "+subj$) K "Save "+f$+" "+~mem%+"+"+~(size%-msg%+hdr%)+" "+~exec%+" "+~load%  eol%=13: + A%=0 1023: data%?A%=10:data%?A%=13  A%: : :store(A$):$ptr%=A$:ptr%? A$=eol%:ptr%=ptr%+1+ A$: )ݤfetch:A$=$ptr%:ptr%=ptr%+1+ A$:=A$ : (ݤDateFix(A$):A$=" "+A$,A$,":")+1) 0 A%=A$,9): A%:A$=A$,A%-1)+" "+A$,A%+1) ! A%=0: A$=A$,2): A$<>32 $T A$=11:=" "+A$ : 14-Nov-1985 .O A$=15:=A$,3)+","+A$,5) : Mon 15 Sep 1986 8V A$,15,1)=":": A$,18,1)=":":=" "+A$ : 21-Nov-1985 12:34:56 BL A$,5,1)=" ": A$,7,1)=" ":A$=A$,5)+"0"+A$,6): Mon, 6 Sep 2008 ... LU A$,8,2)=" ":A$=A$,8)+"0"+A$,10) : Thu Dec 9 15:00:22 ... V; A$,12,1)=" ": A$,15,1)=" ":A$=A$,12)+"19"+A$,13) `` A$,14,1)=":": A$,17,1)=":":A$=A$,3)+", "+A$,9,2)+A$,4,5)+A$,21,4)+A$,11,9)+A$,25) j? A$=24:=A$,3)+","+A$,4) : Mon 15 Sep 1986 16:22:06 tN A$>24:=A$ : Sat, 28 Jun 2008 13:32:52 .... ~=A$ : SetAddrsAndDate 6Date_FromOrd(X%+6,Ldy%,Lmn%,Lyr%,Lh%,Lm%,Ls%,Lc%) 4X%!2=load%:X%?2=X%?10:X%!14=attr%:A%=file(f$,1) :X%!8=f_date(Ldy%,Lmn%,Lyr%):A%=NetFS_OpN(19,5,10,f$) ;X%!8=f_date(Ldy%,Lmn%,Lyr%):X%!10=f_time(Lh%,Lm%,Ls%) 5X%!13=X%!8:X%!15=X%!10:A%=NetFS_OpN(19,64,18,f$) 2((y%4)=0(y%100)<>0y%=0))+36493  d%>146066:d%=d%-146097  =d%=d%*&41EB:mem%!1=d%+d%:d%=((hr%*60+mn%)*60+sc%)*100+cs% #?mem%=d%:mem%!1=mem%!1+d%256: : ($Date_ToOrd(mem%): A%,B%,C%,D% 2@year%=0:month%=0:day%=0:hour%=0:minute%=0:second%=0:centi%=0 <. mem%!1<0:: Problems with negatives ATM FFD%=mem%!1&83D6+2447065:C%=mem%?0+256*(mem%!1&83D6):centi%=C%100 P>C%=C%100:second%=C%60:C%=C%60:minute%=C%60:hour%=C%60 Z8B%=((D%*4+3)146097-4)+3:C%=B%14614*5+2:D%=D%*4+3 d.A%=C%153+2:day%=C%1535+1:month%=A%12+1 n*year%=D%146097*100+B%1461+A%12-4800 x : %ݤd0(A%,N%)="000000000"+ A%,N%) ,ݤs(A$): A$=32::A$=A$,2): A$<>32 / A$,1)=" "::A$=A$, A$-1): A$,1)<>" " =A$ : Bݤfile(f$,A%):$name%=f$:?X%=name%:X%?1=name%256:=(&FFDD)&FF Ugbpb(A%,chn%,addr%,num%,ptr%):?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%: &FFD1: ݤgbpb8(ptr%) ` >&FFFF:!name%=0:ș12,9,"",name%,1,ptr%,32,,,X%!5,X%!9:!name% X%!5=0:ș70,name%A$:=A$ 8X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:&FFD1: X%!5=1:="" 'A%=name%:A%?(1+?A%)=13:=s($(A%+1)) !ݤfs: A%,Y%,E%:=(&FFDA)&FF : +ݤNetFS_Op(A%,A$)=NetFS_OpN(A%,0,7,A$) 8ݤNetFS_OpN(A%,T%,O%,A$):!X%=0:X%?1=O%+1+A$:X%!3=A% "Q>&FFFF:X%?4=T%:$(X%+O%-3)=A$:ș&60048,A%,X%+4,O%+A$,120A%:A%=0:X%?3=0:=0 ,;>&FFFF:A%>&FFFF:X%?3=?A%:ș&2002B,A%+4$(X%+4):=X%?3 62X%!4=0:X%?7=T%:$(X%+O%)=A$:A%=&14:&FFF1:=X%?3 @: JDݤf_date(d%,m%,y%):y%=y%-1981:=d%+m%*256+(y%15)*4096+(y%16)*32 T*ݤf_time(h%,m%,s%):=h%+m%*256+s%*65536 ^0f_date(d%):day%=d%31:month%=(d%&F00)256 h+year%=(d%&F000)4096+(d%&E0)/2+1981: r4f_time(t%):hour%=t%255:minute%=(t%&FF00)256 | second%=(t%&FF0000)65536: