title: List all currently open file handles?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2023608/check-what-files-are-open-in-python">check what files are open in Python</a>  </p>
  </blockquote>
  
  
  
  <p>Hello,</p>
  
  <p>Is it possible to obtain a list of all currently open file handles, I presume that they are stored somewhere in the environment. </p>
  
  <p>I am interested in theis function as I would like to safely handle any files that are open when a fatal error is raised, i.e. close file handles and replace potentially corrupted files with the original files.</p>
  
  <p>I have the handling working but without knowing what file handles are open, I am unable to implement this idea.</p>
  
  <p>As an aside, when a file handle is initialised, can this be inherited by another imported method?</p>
  
  <p>Thank you</p>