> FSTest " Test filing system interface ( v1.00 17-Feb-1992 Original version (G v1.10 08-Sep-2006 Tweeked FNargs0() to avoid zero page on RISC OS 2F v1.11 12-Sep-2006 If OPENUP"*" fails, uses GBPB 8 to find a name <6 v1.12 14-Sep-2007 Add display of context handles F: P26:: :Close:: Z1 ctrl% 31,name% 255:X%=ctrl%:Y%=X%256:go: d: n/Close:chn%=chn%:chn%:A%=chn%:chn%=0:#A% x : 6Wait: :"Press SPACE to continue...";:A%=: : #dump:d%=name% name%+40 4 h0(!d%,8);" ";::'""""; %d%=name% name%+40:v(?d%)::'  : pr(ad%): l% ""Len=";?ad%;(3-?ad%);""""; , ?ad%>0 l%=ad%+1 ad%+?ad%:v(?l%): """";: : #ݤd0(A%,N%)="00000000"+A%,N%) #ݤh0(A%,N%)="0000000"+~A%,N%) ݤdrv(A%)=(48+A%-7*(A%>9)) "4v(A%): A%<31 A%>126 """(";~A%;")"""; A% , 6: @ dir J"Drive: ";:pr(name%) T&'6"Dir: ";:pr(name%+1+?name%) ^*o%=?(name%+2+?name%+?(name%+1+?name%)) h6'6"Owner: ";~o%;" ";:o%=0:"Owner" "Public" r |:  info ,"&05: ";fn$;(11-fn$);:A%=file(fn$,5) B"A%="h0(A%,2)" "h0(X%!2,8)" "h0(X%!6,8)" "h0(X%!10,8)" "; :h0(X%!14,8)" "f_access(X%?14,A%)" "f_prdate(X%!15) ."&FD: ";fn$;(11-fn$);:A%=file(fn$,&FD) B"A%="h0(A%,2)" "h0(X%!2,8)" "h0(X%!6,8)" "h0(X%!10,8)" "; 'h0(X%!14,8)" "f_prdate(X%!6)" "; /X%?13<127:f_prtime(X%!8) h0(X%!11,6) "Info "+fn$:  : ݤf_prdate(A%):A%=A%&FFFF J=d0(A%31,2)+"/"+d0((A%256)15,2)+"/"+(1981+(A%&1000)+(A%&E0)/2)  ݤf_prtime(A%):A%=A%&FFFFFF D=d0(A%255,2)+":"+d0((A%256)255,2)+":"+d0((A%65536)255,2) : &ݤf_access(A%,B%): A$ 0 B%=2:A$="D" A$="-" :#(A%128):A$=A$+"P" A$=A$+"-" D!(A%8):A$=A$+"L" A$=A$+"-" N!(A%4):A$=A$+"E" A$=A$+"-" X!(A%2):A$=A$+"W" A$=A$+"-" b!(A%1):A$=A$+"R" A$=A$+"-" l A$=A$+"/" v"(A%64):A$=A$+"e" A$=A$+"-" "(A%32):A$=A$+"w" A$=A$+"-" "(A%16):A$=A$+"r" A$=A$+"-" =A$+" ",10) : -ݤargs0(A%,Y%,ptr%):?(P-3)=0:E%=Y%:Y%=0 + <&8000:X%=&70:!X%=ptr%:=(&FFDA)&FF 4ș"OS_Args",A%,Y%,ptr% A%,Y%,ptr%:!X%=ptr%:=A% : 3ݤargs(A%,Y%,ptr%):X%,E%:?(P-3)=0:E%=Y%:Y%=0 .<&8000:!&70:X%=&70:!X%=ptr%:&FFDA:=!X% 'ș"OS_Args",A%,Y%,ptr%,,ptr%:=ptr% : #ݤgbpbA(A%,ch%,addr%,num%,ptr%) 8!X%=ch%:X%!1=addr%:X%!5=num%:X%!9=ptr%:=(&FFD1)&FF  : Eݤgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:&FFD1:X%!5=1:=""  #A%=name%:A%?(1+?A%)=13:=$(A%+1) *: 4Bݤfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF >: H,ݤopen:A%:A%="*":A%:=A% =gbpb8(0) R: \: f: pgo z OSARGS TEST  =========== ,X%=ctrl%:Y%=X%256::"OSARGS"'"======"; test$=gbpb8(0) - A$(11,1):B%=01:A%=09:A$(A%,B%):: A%=-3:B%=0:chn%=0:ext%=0 = 51,);19;0;0;0;:::A%=A%+1:A%>6:A%=-3:B%=B%+1 :A%=-3::B%:chn%=test$ 2A%=-3:B%:ext%=args0(&FE,chn%,ext%):ext%=!X% A%>-3:B%:ext%=#chn% Q"A%=";h0(A%,2);", Y%=";h0(chn%,2);", !X%=";h0(ext%,8);": ";A$(A%+3,B%1); 'retA%=args0(A%,chn%,ext%):ret%=!X% 3(51-);"A%=";h0(retA%,2);" !X%=";h0(ret%,8) A%=A%+1:A%>6:A%=-3:B%=B%+1 B%>1:Close < FD,Last drive,Ensure all files,Current FS,Command line B Version type,libfs number,Disk space used,Disk free space,06 $= FD,FE,Ensure file,Read PTR,Write PTR,Read EXT,Write EXT .) Read allocated,Read EOF,Ensure size 86 On RISC OS, FSControl 49 reads device free space B: L: Y%=25 29: A$ V5"A%=FE, Y%=";h0(Y%,2);","(15)"Read HADFS ";A$; `#retA%=args0(&FE,Y%,0):ret%=!X% j3(51-);"A%=";h0(retA%,2);" !X%=";h0(ret%,8) t: ~ CSD,LIB,URD,OPT/USER,CURR :  :Wait : :  OSGBPB TEST  =========== +X%=ctrl%:Y%=X%256::"OSGBPB"'"======" "A%=5, Read disk title:" %!name%=0:A%=gbpbA(5,0,name%,0,0) "A%=";A%;" ";:pr(name%) F'6)"Opt: ";?(name%+1+?name%);" Drive: ";drv(?(name%+2+?name%)) : "'"A%=6, Read directory name:"  %!name%=0:A%=gbpbA(6,0,name%,0,0) "A%=";A%;" ";:dir : ( '"A%=7, Read library name:" 2%!name%=0:A%=gbpbA(7,0,name%,0,0) <"A%=";A%;" ";:dir F: P%'"A%=8, Read directory entries:" Z11"Num: 3 Index: 0" d%!name%=0:A%=gbpbA(8,0,name%,3,0) n0"A%=";A%;11);"Num: ";X%!5;" Index: ";X%!9 x6d%=name%:z%=X%!5 2:6;:pr(d%)::d%=d%+1+?d%: : "'"Checking OSGBPB extensions" Achn%="%":chn%=0:chn%="@":chn%=0:"Can't open '%' or '@'." XB%=9*2-1: "A%=";B%2;(6-);" XY%?0=";chn%((B%1)<>0);(18-);19;0;0;0;::  :B%=B%+1 ] B%<32:(B%1)=0 chn%<>0:!name%=0:name%!8=0:A%=gbpbA(B%2,chn%((B%1)<>0),name%,3,0)  B%<32:(B%1)=0 chn%<>0:!name% name%!8:'"A%=";B%2;"/";chn%((B%1)<>0);11)"Num: 3 Index: 0"'"A%=";A%;11)"Num: ";X%!5;" Index: ";X%!9:dump B%>30: ::Close:Wait : :  OSFILE TEST  =========== +X%=ctrl%:Y%=X%256::"OSFILE"'"======" - A%=1 6: A$(A%,0)::A$(0,0)=gbpb8(0) ,B%=-1: 11::" with *INFO"': =17:  :B%=B%+1 " B%<7:fn$=A$(B%,0):info , B%>6 6 NOFILE,$,%,&,@,^ @: J: T Wait ^: