title: How to determine file size in Fortran 77
body: <p>I have a Fortran program that needs to read ASCII files, however the list of files sometimes includes a file of size 0. The program then crashes when trying to read this file. I have not find any way so far that will allow me to flag such a file. </p>
  
  <p>I have following READ statement in my code</p>
  
  <pre><code>read(10,220,END=320,ERR=195)parm(1:)
  </code></pre>
  
  <p>although I expect code to go to statement 195, or to statement 320, without crashing, it crashes </p>
  
  <p>this is where the code crashes when the file size is zero, with the following messages</p>
  
  <pre><code>...
  fmt: end of file
  apparent state: unit 10 named junko.con
  last format: (A)
  lately reading sequential formatted external IO
  </code></pre>
  
  <ol>
  <li><p>I tried using the INQUIRE statement
  <code>inquire (unit=10,SIZE=nsize)</code>, but the program would not compile</p></li>
  <li><p>the OPEN statement did not give any error when opening the zero size file, and the values of <code>IOSTAT</code> was the same, irrespective of the file size</p></li>
  </ol>