delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/07/14/16:46:11

From: earnie_boyd AT yahoo DOT com (Earnie Boyd)
Subject: Re: Unable to fdopen() a pipe handle
14 Jul 1998 16:46:11 -0700 :
Message-ID: <19980714114946.767.rocketmail.cygnus.gnu-win32@send1b.yahoomail.com>
Reply-To: earnie_boyd AT yahoo DOT com
Mime-Version: 1.0
To: Craig Setera <setera AT us DOT ibm DOT com>
Cc: gw32 <gnu-win32 AT cygnus DOT com>

---Craig Setera <setera AT us DOT ibm DOT com> wrote:
>
> I've got a chunk of code that create an anonymous pipe using pipe()
and then
> attempts to create a write stream on the pipe using fdopen()
(something like
> this... from memory... not necessarily correct):
> 
> int mypipe[2];
> FILE *mystream;
> 
> pipe(mypipe);
> mystream = fdopen(mypipe[1], "w");
> 
> I can't seem to get fdopen() to return anything other than NULL. 
Any thoughts?

Well, I thought I had some then I started some research.  I've drawn
the conclusion that it won't work because the pipes are half-duplex. 
However, you should be able to fopen a /dev/null and use dup2 to
accomplish what you want (maybe:).

Anybody else?
==
-        \\||//
---o0O0--Earnie--0O0o----
--earnie_boyd AT yahoo DOT com--
------ooo0O--O0ooo-------



_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019