Hi,
Short question..
Is there any way I can convert a file descriptor to either a FILE* or a C++ stream ifstream on windows.
HANDLE hFile;
hFile = CreateFile(filename, // open One.txt
GENERIC_READ, // open for reading
0, // do not share
NULL, // no security
OPEN_EXISTING, // existing file only
FILE_ATTRIBUTE_NORMAL, // normal file
NULL); // no attr. template
int fd = (int)hFile;
FILE* pFile = fd; ///how to convert fd to FILE* ?????????
or
ifstream ifs = fd;///how to convert fd to ifstream ???????????????
HANDLE hFile;
hFile = CreateFile(filename, // open One.txt
GENERIC_READ, // open for reading
0, // do not share
NULL, // no security
OPEN_EXISTING, // existing file only
FILE_ATTRIBUTE_NORMAL, // normal file
NULL); // no attr. template
int fd = (int)hFile;
FILE* pFile = fd; ///how to convert fd to FILE* ?????????
or
ifstream ifs = fd;///how to convert fd to ifstream ???????????????
To copy to clipboard, switch view to plain text mode
Bookmarks