title: How to open an ifstream from a file descriptor?
body: <p>I am trying to implement an encryption on a file through s3fs using rc4. Basically I need to take a file descriptor that s3fs gives use it to extract the name of the file and then do the thing. So how would I do that in c++?</p>
  
  <p>I don't have any code to show because I don't know how to start it  would look something like:</p>
  
  <pre><code>void foo(int fd){
  // something
  
  string temp; 
  temp = // result of that somethingthing;
  ifstream in;
  in.open(temp,ios::binary | ios::in);
  }
  </code></pre>
  
  <p>Is this even doable? Or am I just doomed to use system calls?</p>