
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] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH