title: Reading a File while it is being written by another process
body: <p>I'm trying to read binary data from a buffer file which is continuously written to by a different process (that I cannot modify). I'm using the following code in order to open the file:</p>
  
  <pre><code>fileH = CreateFileA((LPCSTR)filename,
                      GENERIC_READ,
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
                      NULL,
                      OPEN_EXISTING,
                      FILE_ATTRIBUTE_NORMAL, NULL);
  </code></pre>
  
  <p>And it opens correctly with no error. However, when I read data from the file, it seems to block the other process from writing to the file since I loss data.</p>
  
  <p>The buffer is circular, meaning that the file size is fixed, and new data is constantly written over older data in the buffer. </p>
  
  <p><strong>EDIT:</strong>
  Sometimes the most trivial solution works...</p>
  
  <p>I've contacted the software company and told them about the bug, and within a day they posted a new version with a fix. 
  Sorry this cannot work for everybody.</p>