> MkIndx ; Automatic index maker for the Fruitcake Freeware site  (< (c) 1997 Matthew Astley matthew@fruitcake.demon.co.uk 27 matthew@spuddy.mew.co.uk <> I know it's a tacky program, but what do you expect from F@ something that I wanted to write as an obey file at first? P Z8 If you like the way it works, use it by all means. d& If you don't like it, change it! n x@ Note that it tries to add the same suffix you'd get if you A uploaded the files to the web site with ArcWeb's ftp client mode. See DATA at the end. : &dir$="Homes:mca1001.demon-www.pub" [self$="http://www.fruitcake.demon.co.uk/pub/MkIndx.ffb": please leave the original URL progname$="MkIndx" out$="index" head$="header" det$="details" (list_tag$="dl>" : nb. no opening < prog_tag$="
" info_tag$="
" 'time_form$="%dy %m3 %ce%yr %24:%mi" : 'out%=0:inp%=0:det%=0:max%=40:cnt%=0  :error " block% 256: blk2% 8 ,5 n$(max%-1),lo%(max%-1),ex%(max%-1),len%(max%-1) 6out%=(dir$+"."+out$) @inp%=(dir$+"."+head$) Jdet%=(dir$+"."+det$) T7 inp%=0 1,"File '"dir$+"."+head$+"' not found" ^6 det%=0 1,"File '"dir$+"."+det$+"' not found" h5 out%=0 1,"Can't create '"+dir$+"."+out$+"'" r$"SetType "+dir$+"."+out$+" faf" |  a$=#inp%  a$=""  #out%,"<"+list_tag$ . file_recurse(dir$,"FNfile(f$)","0",)  bubble  file%=0 cnt%-1  dump(file%)   #out%,"Generated "+$+" by "+progname$+".ffb, " 8#out%,"header file, " &6#out%,"details file" 0%#out%,"" :#out%:out%=0 D#det%:det%=0 N X: b error l out%<>0 #out%:out%=0 v det%<>0 #det%:det%=0  inp%<>0 #inp%:inp%=0  1,$+" at line "+Þ  :  bubble: n%,pass% A Grind, grind ... look on the bright side, you don't need to  wait for it very often.  cnt%<2   pass%=  n%=0 cnt%-2 r order(n%) Ȕ n$(n%),n$(n%+1):Ȕ lo%(n%),lo%(n%+1):Ȕ ex%(n%),ex%(n%+1):Ȕ len%(n%),len%(n%+1):pass%=   pass%   :   order(n%) *#blk2%!0=ex%(n%):blk2%!4=lo%(n%) 4Wș "OS_ConvertDateAndTime",blk2%,block%,128,"%ce%yr%mn%dy%24%mi%se%cs",lo%:?lo%=13 >'blk2%!0=ex%(n%+1):blk2%!4=lo%(n%+1) H[ș "OS_ConvertDateAndTime",blk2%,block%+128,128,"%ce%yr%mn%dy%24%mi%se%cs",lo%:?lo%=13 R=$block% < $(block%+128) \: f* file(f$): a$,flg%,ft%,lo%,ex%,len% p> cnt%>=max% 1,"Too many files - please increase max%" z*ș "OS_File",17,f$ ft%,,lo%,ex%,len% . ft%<>1 ft%<>3 ș "OS_File",19,f$,ft% B (lo% &FFF00000) <> &FFF00000 1,"Untyped file '"+f$+"'" n$(cnt%)=last_bit(f$) lo%(cnt%)=lo% ex%(cnt%)=ex% len%(cnt%)=len%  cnt%+=1 =0 :  dump(n%): ftn%,ft% "ft%=(lo%(n%) &000FFF00) >> 8 blk2%!0 = ex%(n%) blk2%!4 = lo%(n%)  #det%=0  flg%=0  $ a$=#det% . a$,1)="#" a$="" 8 a$="" flg%=1 flg%=0 B a$="" flg%=2 flg%=3 L" a$>"" flg%=2 #out%,a$ V a$>"" flg%=0 `- match(n$(n%),a$) flg%=2 flg%=1 j flg%=2 t ~ : ftn%: ftn%<>-1 ft$:ft$="."+ft$ ft$=""  ftn%=-1 ftn%=ft% D ș "OS_ConvertFileSize",len%(n%),block%,256 ,lo%:?lo%=13 i #out%,prog_tag$+""+n$(n%)+", ["+$block%+"], last changed "; Q ș "OS_ConvertDateAndTime",blk2%,block%,256,time_form$ ,lo%:?lo% = 13  #out%,$block%+""  #out%,info_tag$;    flg%=3 #det% b flg%<2 n$(n%)<>det$ n$(n%)<>head$ n$(n%)<>out$ "Warning: "+n$(n%)+" has no details"  :  6 match(a$,b$):=(upper(a$,(b$))) = upper(b$)) : 0 file_recurse(f$,Fcom$,Dcom$,img%): i%,n% (< If f$= then EVAL(Fcom$) else EVAL(Dcom$):recurse 28 If img%=TRUE then treat image files as directories <+ Requires >255 bytes storage at block% Fș "OS_File",17,f$ f%,,l% P5 f%=0 Enumber%=: 1,"File '"+f$+"' not found" Z f%=2 (f%=3 img%) d n%=(Dcom$) n i%=0 x 6 ș "OS_GBPB",9,f$,block%,1,i%,256,"*" ,,,n%,i% B n% file_recurse(f$+"."+gname(block%),Fcom$,Dcom$,img%)  i%=-1   n%=(Fcom$)   :  last_bit(name$): a% 7 (name$,".")=0 name$,":")=0) name$="" =name$   a%=name$,".")+1  a%=1 a%=name$,"::")  name$=name$,a%) 8 (name$,"::")=0 name$,".")=0) name$="" a%=1 & name$,2)="::" name$=name$,2) " =name$ ,: 6 gname(ptr): f$ @f$="":ȕ ?ptr>=32 Jf$+=?ptr:ptr+=1: T=f$ ^: h upper(i$): a%,b% r Convert to upper case | a%=1 (i$)  b%=(i$,a%,1)) / b%>=97 b%<=122 i$,a%,1)=(b% &DF)  =i$ : % Extensions as ArcWeb adds them:  &fff,txt  &ddc,zip  &faf,html  &695,gif  &FFB,ffb  -1