title: C# Unlock file used by running process
body: <p>I am attempting to change an existing file stream from within C#. The process that holds the stream is outside of my control and I cannot view or access it's code.</p>
  
  <p>The file stream is opened in a read/write state with a lock preventing file share. I am attempting to alter the stream state <em>in place without closing it</em>, as closing the handle of the stream immediately causes the process to crash.</p>
  
  <p>No alternative methods are possible, the original file needs to be accessed; not a copy. Altering the permissions on the file has no effect on the lock. Pausing the process, closing the handle and attempting to recreate it with the same handle id does not seem to be working, as the program does not seem to accept the handle and simply closes.</p>
  
  <p>Any help would be greatly appreciated!</p>