title: read an empty file with fread
body: <p>I am trying to read an empty file with fread. Before i created the file with a blocksize of 4096 and an amount of 40 blocks. At the moment I know that these Blocks are "empty" but if i read the file like in my code below I cannot tell wether it is empty or not. I mean I am expecting nread to be NULL or something like that. 
  Do you know what I have to compare nread with? Thank you!</p>
  
  <pre><code>int test()
  {
  
     char buf[4096];
     FILE *file;
     size_t nread;
  
     file = fopen("out/abc.store", "r");
     if (file) {
         while ((nread = fread(buf, 1, sizeof buf, file)) &gt; 0)
            fwrite(buf, 1, nread, stdout);
        if (ferror(file)) {
        /*error handling*/
     }
     fclose(file);
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I created the file like that:</p>
  
  <pre><code>char *content=(char*)malloc(uintBlockSize*uintBlockCount);
  memset(content,0,uintBlockSize*uintBlockCount);
  ...
   while (i!=0)
   {
     check=fwrite(content,uintBlockSize, 1, storeFile);
     if (check!=1)
         return 1;
     i--;
   }
  </code></pre>