title: file access exception that I can't shake
body: <p>I have a third party api that is dropping a file into a directory every 100 miliseconds.  Sometimes I can grab it and read it, but I am swallowing a lot of "process cannot access the file because it is being used by another process" exceptions just to get one good read.  How do I stop this exception from happening?</p>
  
  <p>Here is the code I am using.  I read that using "using" statements should prevent this error, but it's not helping.</p>
  
  <pre><code>string content = "";
  string path = "C:\\output.txt";
  
  using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.ReadWrite)) 
  {
      byte[] b = new byte[1024];
      UTF8Encoding temp = new UTF8Encoding(true);
  
      while (fs.Read(b, 0, b.Length) &gt; 0) 
      {
          content += temp.GetString(b);
      }
  }
  </code></pre>