title: Read file after EOF
body: <p>Is possible to read a file after its EOF?</p>
  
  <p>I am reading a file which could contain an EOF character before its ending or multiple EOF characters. The file is a simple txt, and I am able to know the number of characters using fsize but looks like getc returns EOF (or -1) from the EOF to the end of the file.</p>
  
  <pre><code>int c = 0;
  char x;
  FILE *file = fopen("MyTextFile.txt", "r");
  off_t size = fsize("MyTextFile.txt");
  
  while (c &lt; size) {
      x = getc(file);
      if (x != -1)
          printf("%c ", x);
      else
          printf("\nFOUND EOF!\n");
      c++;
  }
  fclose(file);
  </code></pre>
  
  <p>Unfortunately, even if I'm sure the file content continues after the EOF I cannot read the rest.</p>
  
  <p>SOLVED:
  Reading using "rb" instead of "r" and using x as int allowed me to read the whole file, including multiple EOF. Not sure if it's a trick or if it's something allowed, but works.</p>