*BSD News Article 79506


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!cancer.vividnet.com!hunter.premier.net!news.mathworks.com!fu-berlin.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Blocking with pipes.
Date: 29 Sep 1996 14:07:12 GMT
Organization: Private BSD site, Dresden
Lines: 20
Message-ID: <52lvqg$67m@uriah.heep.sax.de>
References: <52k448$sjj@herald.concentric.net>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E

averba@eden.rutgers.edu (Andrew Verba) wrote:

> 	while(read(fd[0],string,50) > 0 ) {
> 		do something with string;
> 	}

> Why does this read some of the input from the executing file and then
> hang (block) ?

I can't get it to work either.  It works when using two pipes,
however.  I think your called application gets confused that stdin and
stdout do refer to the same object.  Well, not sure, just a wild
guess...

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)