Re: [Haskell-cafe] Execution of external command

2007-12-16 Thread Jonathan Cast
On 14 Dec 2007, at 1:21 AM, Jules Bean wrote: Evan Laforge wrote: it seems that script may be not terminated if its output isn't read, so better code should be (_, h, g, _) - runInteractiveCommand script params result - hGetLine h hGetContents h = evaluate.length hGetContents g =

Re: [Haskell-cafe] Execution of external command

2007-12-14 Thread Jules Bean
Evan Laforge wrote: it seems that script may be not terminated if its output isn't read, so better code should be (_, h, g, _) - runInteractiveCommand script params result - hGetLine h hGetContents h = evaluate.length hGetContents g = evaluate.length Tangent here, but does anyone else think

Re: [Haskell-cafe] Execution of external command

2007-12-13 Thread Duncan Coutts
On Thu, 2007-12-13 at 15:48 +0300, Bulat Ziganshin wrote: Hello haskell-cafe, please help me with selection of proper function to use i need to run external command with parameter and get its stdout, smth like this: output - system cmd param the code should be compatible with unix

Re: [Haskell-cafe] Execution of external command

2007-12-13 Thread Yitzchak Gale
Hi Bulat, You wrote: please help me with selection of proper function to use i need to run external command with parameter and get its stdout, smth like this: output - system cmd param the code should be compatible with unix and windows, and it should be possible to execute scripts (so afaiu

Re: [Haskell-cafe] Execution of external command

2007-12-13 Thread Yitzchak Gale
so, do (stdin,stdout,stderr,ph) - runInteractiveCommand script param waitForProcess ph when i should read stdout? before or after waitForProcess? If you are sure that your script will behave nicely (or don't care if it doesn't), how about just: (_, h, _, _) - runInteractiveCommand script

Re: [Haskell-cafe] Execution of external command

2007-12-13 Thread Duncan Coutts
On Thu, 2007-12-13 at 15:06 +0200, Yitzchak Gale wrote: Hi Bulat, You wrote: please help me with selection of proper function to use i need to run external command with parameter and get its stdout, smth like this: output - system cmd param the code should be compatible with