Hi,
Short question..

Is there any way I can convert a file descriptor to either a FILE* or a C++ stream ifstream on windows.
Qt Code:
  1. HANDLE hFile;
  2. hFile = CreateFile(filename, // open One.txt
  3. GENERIC_READ, // open for reading
  4. 0, // do not share
  5. NULL, // no security
  6. OPEN_EXISTING, // existing file only
  7. FILE_ATTRIBUTE_NORMAL, // normal file
  8. NULL); // no attr. template
  9.  
  10. int fd = (int)hFile;
  11. FILE* pFile = fd; ///how to convert fd to FILE* ?????????
  12. or
  13. ifstream ifs = fd;///how to convert fd to ifstream ???????????????
To copy to clipboard, switch view to plain text mode