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.




MODULE FSize EXPORTS Main;
 
IMPORT IO, Fmt, FS, File, OSError;
 
VAR fstat: File.Status;
 
BEGIN
  TRY
    fstat := FS.Status("input.txt");
    IO.Put("Size of input.txt: " & Fmt.LongInt(fstat.size) & "\n");
    fstat := FS.Status("/input.txt");
    IO.Put("Size of /input.txt: " & Fmt.LongInt(fstat.size) & "\n");
  EXCEPT
  | OSError.E => IO.Put("ERROR: Could not get file status.\n");
  END;
END FSize.