* > BLib.Generic.FileIO 1.05 22Mar2008 0 v1.05 22Mar2009 Optimised CDIR in FNfile() , v1.04 22Mar2008 FNf_scan strips spaces (7 v1.03 15Feb2008 Add veneer functions in f_ domain 2K v1.02 28Apr2007 Added functions to FNfile on DOS, PROCcdir, FNopenout <7 v1.01 07Sep2006 FNargs avoid zero page on RISC OS F% v1.00 09Aug1988 Initial version P: Z% General File Interface Routines d% =============================== n: x8 FNfile(), PROCgbpb(), FNfs are callable on Windows 8 -------------------------------------------------- : , Returns file type, file info in X%!... , -------------------------------------- Rݤfile(A$,A%):A%-8:<&FFFFF:$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF TA$=f_name(A$):A%=255 A%=5:X%!14=(A$):X%!14:X%!10=#X%!14:#X%!14:X%!14=&33 1A%=255:X%?6=0:"LOAD """+A$+""" "+~X%!2:=1 A%=5:X%!14:=1 A%=5:=0 FA%=0:"SAVE """+A$+""" "+~X%!10+" "+~X%!14:X%!10=X%!14-X%!10:=1 BA%=7:"SAVE """+A$+""" "+~+"+"+~X%!10:X%!10=X%!14-X%!10:=1 A%-8:=0 -(os%-24):A$="mkdir "+A$ A$="cdir "+A$ >&FFFF: : :=0  A$:=2 :  General OSGBPB call " ------------------- ,%f_gbpb(A%,chn%,addr%,num%,ptr%) 6>?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:<&FFFFF:&FFD1: @A%=1A%=3:#?X%=X%!9 J5:A%=1A%=2:#?X%,?X%!1 A%=3A%=4:?X%!1=#?X% T5X%!1=X%!1+1:X%!5=X%!5-1:(#?X% A%>2) X%!5<1: ^: h#gbpb(A%,chn%,addr%,num%,ptr%) r>?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:<&FFFFF:&FFD1: |A%=1A%=3:#?X%=X%!9 5:A%=1A%=2:#?X%,?X%!1 A%=3A%=4:?X%!1=#?X% 5X%!1=X%!1+1:X%!5=X%!5-1:(#?X% A%>2) X%!5<1: : @ Return current disk (5), directory (6) or library (7) name @ ---------------------------------------------------------- ݤgbpb(A%):>&FFFFF:="" NX%!1=name%:&FFD1:A%=name%+((1+?name%)((A%-2)=6)):A%?(1+?A%)=13:=$(A%+1) : B Returns entry in current directory, or null string if at end B ------------------------------------------------------------  ݤf_scan(ptr%):>&FFFFF:="" 7X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:&FFD1:X%!5=1:="" 7A%=name%+1:A%!(A%?-1)=&D20:A%?($A%," ")-1)=13:=$A% : ݤgbpb8(ptr%):>&FFFFF:="" 7X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:&FFD1:X%!5=1:="" &7A%=name%+1:A%!(A%?-1)=&D20:A%?($A%," ")-1)=13:=$A% 0: :7 OSARGS call with data. Returns any returned data D7 ------------------------------------------------- N6ݤf_args(A%,Y%,ptr%): X%,E%:?(P-3)=0:E%=Y%:Y%=0 X b& !&70:X%=&70:!X%=ptr%:&FFDA:=!X% l v#ș"OS_Args",A%,Y%,ptr% ,,ptr%  :=ptr% : 4ݤargs(A%,Y%,ptr%): X%,E%:?(P-3)=0:E%=Y%:Y%=0  & !&70:X%=&70:!X%=ptr%:&FFDA:=!X%  #ș"OS_Args",A%,Y%,ptr% ,,ptr%  :=ptr% : ' OSARGS call ignoring X, returns A ' --------------------------------- ݤf_argsA(A%): ( X%,Y%,E%,!&70:X%=&70:=(&FFDA)&FF   ș"OS_Args",A% A%  :=A%  : *ݤargsA(A%): 4( X%,Y%,E%,!&70:X%=&70:=(&FFDA)&FF > Hș"OS_Args",A% A% R :=A% \: f& Get current filing system number p& -------------------------------- z.ݤfs:(os%-32)=0: A%,Y%,E%:=(&FFDA)&FF =29 :  Delete an object  ----------------