FILE* and streams

Hello all,
   I'm making use of a static library that makes use of stdout and stderr as input to different functions that require a FILE* as a parameter.  I would like to make use of these functions, but do not want to create a temporary, ( or permanent for that matter ), file on the drive to make use of the functions.  What can I do to pass a stream into this function so that I can read the output from the function?

Thanks much.
LVL 1
edcAsked:
Who is Participating?
 
grg99Commented:
Note that pipes are kinda shaky-- the semantics of multiple pipe readers are very fuzzy.  Also Windows 95/98 are only half-assed-- they can be pipe clients but not servers.  Yet another intentional cripling, thanks MSoft.

I'd try using a temporary file, much easier and works on all OS's.

0
 
grg99Commented:
You could use a pipe.  Depending on the OS, it could be as simple as opening a file named "\\.\\pipe\\MyPipe".

0
 
edcAuthor Commented:
Hi grg99.  The OS is windows, (most likely 2K, XP and 2003, but could also be 9x).  Would the pipe work on the Windows OSs?

Thanks much.
0
 
edcAuthor Commented:
Also, if so, where can I find documentation on how to use it?

Thanks again.
0
 
nonubikCommented:
Of course you can use pipes on Windows. Take a look here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/pipes.asp
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.