" > BLib.Path 1.02 J.G.Harston - Platform-independant pathname functions : (: 25 PROCf_init - initialise filing-system variables <5 ----------------------------------------------- F f_init P0):B%:A%=B%-1 A%:=A$,A%) +":$%&^@\-",A$,1)):=A$,A$+d$,d$)-1) ="" : : ) FNfn_leaf(path$) - returns leafname ) ----------------------------------- &ݤfn_leaf(A$):A%,B%:A%=A$,":",2) +B%=A%:A%=A$,d$,A%+1):A%=0:=A$,B%+1) : : ) FNfn_path(path$) - returns pathname ) ----------------------------------- "&ݤfn_path(A$):A%,B%:A%=A$,":",2) ,)B%=A%:A%=A$,d$,A%+1):A%=0:=A$,B%) 6: @: J4 FNfn_ext(path$) - returns leafname's extension T4 ---------------------------------------------- ^ݤfn_ext(A$):A$,s$)=0:="" h1 A%:A%=A$+1:A%=A%-1:":"+d$+s$,A$,A%,1)) r A$,A%,1)=s$:=A$,A%) ="" |: : 8 FNfn_noext(path$) - returns path with no extension 8 -------------------------------------------------- !ݤfn_noext(A$):A$,s$)=0:=A$ 1 A%:A%=A$+1:A%=A%-1:":"+s$+d$,A$,A%,1)) "A$,A%,1)=s$:=A$,A%-1) =A$ : : = FNfn_fullpath(path$, file$) - return full absolute path = ------------------------------------------------------- ݤfn_fullpath(P$,A$) '"$%&^\-",A$,1)):(os%-24)=0:=A$ A$,":")A$,1)=d$:=A$ =P$+d$,P$,1)<>d$)+A$ : : &E FNf_name(path$) - ensure no extension if no extension specified 0E --------------------------------------------------------------- :ݤf_name(A$) DK?(P-3)=0:A%,B%:B%=A%:A%=A$,d$,A%+1):A%=0:A$,".",B%)=0:A$=A$+"." N=A$ X: b: