converting file descriptor to FILE pointer

Discussion in 'General Computer Support' started by HelloC++, May 24, 2007.

  1. HelloC++

    HelloC++

    Joined:
    May 24, 2007
    Messages:
    1
    I have a file descriptor, is there any way I can convert it to FILE* or ifstream* on windows.

    Code:
    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 ???????????????
    Thanks
    HelloC++, May 24, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q3liZXJMb3R1cw==?=

    Pointer for questionnaires on Microsoft technologies

    =?Utf-8?B?Q3liZXJMb3R1cw==?=, Feb 10, 2005, in forum: Microsoft Certification
    Replies:
    5
    Views:
    509
    CrushesBeforeItCuts
    Feb 11, 2005
  2. Brian H¹©

    Re: Mouse Pointer

    Brian H¹©, Jul 6, 2003, in forum: Computer Support
    Replies:
    7
    Views:
    846
    Juan Pérez
    Jul 8, 2003
  3. °Mike°

    Re: Mouse Pointer

    °Mike°, Jul 6, 2003, in forum: Computer Support
    Replies:
    0
    Views:
    476
    °Mike°
    Jul 6, 2003
  4. =?UTF-8?B?UGFsaW5kcuKYu21l?=

    How do I get a posting from its descriptor?

    =?UTF-8?B?UGFsaW5kcuKYu21l?=, Jun 26, 2004, in forum: Computer Support
    Replies:
    4
    Views:
    434
    =?UTF-8?B?UGFsaW5kcuKYu21l?=
    Jun 26, 2004
  5. zxcvar

    Converting JPG file ppt file [Powerpoint] file

    zxcvar, Nov 4, 2003, in forum: Digital Photography
    Replies:
    7
    Views:
    28,681
    TheMountain
    Jun 22, 2009
Loading...

Share This Page