[Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Jason Dusek
I've put together a simple test case for a rather annoying problem. I've got a program that drives other programs. For example, it can drive `cat`: :; Simple cat a-file When the file is a little bit greater than 135060 bytes, this program fails to produce any output at all -- I need

Re: [Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Brandon S. Allbery KF8NH
On 2008 Nov 10, at 16:29, Jason Dusek wrote: I've put together a simple test case for a rather annoying problem. I've got a program that drives other programs. For example, it can drive `cat`: :; Simple cat a-file When the file is a little bit greater than 135060 bytes, this program fails

Re: [Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Krzysztof Skrzętnicki
Yep, that's your problem. forkIO the hPut. I can see the that thing biting a lot of people. Maybe there should be a warning in docs that this particular combination: feed input read output waitForProcess is just likely to produce deadlocks? All best Christopher

Re: [Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Jason Dusek
simple exe bytes args= do (i, o, e, p)- runInteractiveProcess exe args Nothing Nothing hPut i bytes s - hGetContents o hClose i return s Yep, that's your problem. forkIO the hPut. Maybe I didn't do enough here -- just

Re: [Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Jason Dusek
This does not work either. It should cover all the bases, right? Fork off input, pull things from ouput as they are ready, stop when we reach end of file. If you remove the line `print partial`, the program loops forever; if you keep it, the program stops right there. -- _jsn import

Re: [Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Brandon S. Allbery KF8NH
On 2008 Nov 10, at 19:04, Jason Dusek wrote: simple exe bytes args= do (i, o, e, p)- runInteractiveProcess exe args Nothing Nothing hPut i bytes s - hGetContents o hClose i return s Yep, that's your problem. forkIO the hPut. Maybe I

Re: [Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Jason Dusek
That was just me being absent-minded -- I have threaded in my Cabal file but was not using it on the command line for my little test script. Thank you for calling it to my attention. -- _jsn ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Daniel Franke
Jason Dusek [EMAIL PROTECTED] writes: simple exe bytes args= do (i, o, e, p)- runInteractiveProcess exe args Nothing Nothing hPut i bytes s - hGetContents o hClose i return s Yep, that's your problem. forkIO the hPut.

Re: [Haskell-cafe] catting to cat gets stuck at 135K

2008-11-10 Thread Jason Dusek
I am using 6.8.3 -- it is almost exciting to realize how close I came to 'impossible' instead of 'annoying'. Living on the edge with UNIX IO! -- _jsn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org