Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can I get a FILE* from a HANDLE?

Can I get a FILE* from a HANDLE?

Scheduled Pinned Locked Moved C / C++ / MFC
delphiquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sashoalm
    wrote on last edited by
    #1

    Hi, I have a HANDLE which is an unnamed pipe, so I can't open it the usual way with fopen. I want to use stdio functions like fscanf on it, so I'm looking for a way to obtain a FILE* from that HANDLE.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    S _ 2 Replies Last reply
    0
    • S sashoalm

      Hi, I have a HANDLE which is an unnamed pipe, so I can't open it the usual way with fopen. I want to use stdio functions like fscanf on it, so I'm looking for a way to obtain a FILE* from that HANDLE.

      There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

      S Offline
      S Offline
      sashoalm
      wrote on last edited by
      #2

      Never mind, I found out how - _fdopen.

      There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

      1 Reply Last reply
      0
      • S sashoalm

        Hi, I have a HANDLE which is an unnamed pipe, so I can't open it the usual way with fopen. I want to use stdio functions like fscanf on it, so I'm looking for a way to obtain a FILE* from that HANDLE.

        There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        Here is a good read - A Handy Guide To Handling Handles[^]

        «_Superman_» I love work. It gives me something to do between weekends.
        Microsoft MVP (Visual C++)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups