Subprocesses (was: [ANNOUNCE] shell-haskell 1.0.0)
Fri, 9 May 2003 11:03:13 +0100
There are currently two ways to create and communicate with external
- System.Cmd.system (very basic, doesn't give you access to the
process's output but you can use shell primitives to redirect its
- Posix.runProcess (can specify Handles for the process's
but it doesn't create pipes so you can't actually communicate with
the subprocess using these Handles.).
- POpen.popen (can specify an input String, and gives you lazy output
Strings. No interactive communication is possible.)
Ok, *three* ways. System.Cmd.system, Posix.runProcess, POpen.popen, and
shell-haskell. Er. *Four* ways.
David Sankel's shell-haskell creates pipes for stdin/stdout/stderr, and
lets you communicate interactively with the sub-process via Handles. It
could do with a way to specify the environment and working directory of
the sub-process (ala POpen and runProcess), but apart from that it seems
to be the most flexible of the four. It could be simplified slightly by
using one Handle rather than two for stdin/stdout.
We should think about what functionality we want to provide in the core
libraries. My preference would be to go for a full version with three
pipes (like shell-haskell) and perhaps one or two more specialised
versions covering common cases (I don't know what these should be,
What do people think?
From: firstname.lastname@example.org [mailto:email@example.com] On
Behalf Of David Sankel
Sent: 06 May 2003 03:06
Subject: [ANNOUNCE] shell-haskell 1.0.0
shell-haskell provides utilities to communicate with
other process's via Haskell code. This library can be
used for something as simple as getting the output of
another program or as complex as interacting with an
David J. Sankel
Haskell mailing list