title: How can I find which process has opened a specific file?
body: <p>How can I find which processes have a specific file opened, and their open, access and share modes? Additionally, is it possible to change these values for a process? Or is it even possible to open a file for reading if it is already opened for exclusive access by another process?</p>
  
  <p>Please note that I don't want to invalidate the handle of the process having the file opened. I just want to be able to access the file (if possible).</p>
  
  <p>(I'm mainly asking about Windows, but solutions for other platforms are welcome, since they contribute to the community's knowledge.)</p>
  
  <p>Edit: I found some answers for my first question <a href="https://stackoverflow.com/questions/183925/what-win32-api-can-be-used-to-find-the-process-that-has-a-given-file-open">here</a> and <a href="https://stackoverflow.com/questions/231547/tracing-which-process-that-has-opened-a-particular-file">there</a>.</p>
  
  <p>Edit 2: Thanks everybody for the tools you mentioned, but I am mainly looking for programmatical techniques (e.g. using Win32 APIs).</p>