title: How to get open files of a subprocess?
body: <p>How to get open files of a subprocess?</p>
  
  <p>i opened a subprocess which generate files, i want get file descritor of these files to do fsync on them</p>
  
  <p>so if i have code like this:</p>
  
  <pre><code>p = subprocess.Popen([
              'some_program'
  ])
  </code></pre>
  
  <p>the process p generate some files
  i can get the process id of the subprocess using:</p>
  
  <pre><code>p.pid
  </code></pre>
  
  <p>but how can i get fd of these files to call flush and fsync() on them?</p>
  
  <p>actually i find a utility called "lsof" (list open files)
  but it is not installed or supported on my system, so i did not do further investigations on it, as i really need a standard way</p>
  
  <p>thanks</p>