Verify the size of a file called     input.txt     for a file in the current working directory, and another one in the file system root.




(getFileSize=
  size
.     fil$(!arg,rb)     {read in binary mode}
    & fil$(,END)        {seek to end of file}
    & fil$(,TEL):?size  {tell where we are}
    & fil$(,SET,-1)     {seeking to an impossible position closes the file, and fails}
  | !size               {return the size}
);
 
getFileSize$"valid.bra"
113622
 
getFileSize$"c:\\boot.ini"
211
 