[Haskell-cafe] runProcess does not care about hSetBuffering?

2009-07-28 Thread Magicloud Magiclouds
Hi,
  Code like:
(or_, ow_) - createPipe
or - fdToHandle or_
ow - fdToHandle ow_
hSetBuffering ow LineBuffering
hSetBuffering or LineBuffering
h - runProcess cmd [] Nothing Nothing Nothing (Just ow) Nothing
  In the cmd process, the ow is not LineBuffering
-- 
竹密岂妨流水过
山高哪阻野云飞
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] runProcess does not care about hSetBuffering?

2009-07-28 Thread Brandon S. Allbery KF8NH

On Jul 28, 2009, at 21:14 , Magicloud Magiclouds wrote:

(or_, ow_) - createPipe
or - fdToHandle or_
ow - fdToHandle ow_
hSetBuffering ow LineBuffering
hSetBuffering or LineBuffering
h - runProcess cmd [] Nothing Nothing Nothing (Just ow) Nothing
 In the cmd process, the ow is not LineBuffering


Buffering is not an attribute of a filehandle, but of the I/O  
library.  There is no way for you to tell cmd how you want it to  
buffer, unless it has an option to do so (cat -u, tcpdump -l, etc.),  
although you can hint by using a pty instead of a pipe:  many programs  
will switch to line buffering in that case, some will go unbuffered;  
usually, a pipe, FIFO, or ordinary file will be block buffered.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe