title: Retrieving file descriptor from a std::fstream
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/109449/getting-a-file-from-a-stdfstream">Getting a FILE* from a std::fstream</a>  </p>
  </blockquote>
  
  
  
  <p>I am working on Linux and file descriptors are the main model in this OS. </p>
  
  <p>I was wondering whether is there any library or any way to retrieve the native Linux file descriptor starting from a C++ <code>std::fstream</code>.</p>
  
  <p>I thought about <code>boost::iostream</code> since there is a class called <code>file_descriptor</code> but I understood that its purpose is different from the one I want to achieve.</p>
  
  <p>Do you know some way to do that?</p>