Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

FILE* and streams

Posted on 2004-08-30
5
Medium Priority
?
275 Views
Last Modified: 2010-04-01
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.
0
Comment
Question by:edc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:grg99
ID: 11936100
You could use a pipe.  Depending on the OS, it could be as simple as opening a file named "\\.\\pipe\\MyPipe".

0
 
LVL 1

Author Comment

by:edc
ID: 11936143
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
 
LVL 1

Author Comment

by:edc
ID: 11936149
Also, if so, where can I find documentation on how to use it?

Thanks again.
0
 
LVL 16

Expert Comment

by:nonubik
ID: 11940884
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
 
LVL 22

Accepted Solution

by:
grg99 earned 500 total points
ID: 11941289
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question