[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 14:57:34 UTC 2010


The following commit has been merged in the master branch:
commit 71845612fa4097f1523815a788c0dbe928f95e56
Author: John Goerzen <jgoerzen at complete.org>
Date:   Mon Apr 18 03:38:31 2005 +0100

    Touching up MissingH.Cmd docs

diff --git a/MissingH/Cmd.hs b/MissingH/Cmd.hs
index c8f2678..16d330a 100644
--- a/MissingH/Cmd.hs
+++ b/MissingH/Cmd.hs
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    Stability  : provisional
    Portability: portable to platforms with POSIX process/signal tools
 
- Command invocation utilities.
+Command invocation utilities.
 
 Written by John Goerzen, jgoerzen\@complete.org
 
@@ -46,6 +46,28 @@ globally, you can simply run:
 See also: 'MissingH.Logging.Logger.updateGlobalLogger',
 "MissingH.Logging.Logger".
 
+It is possible to set up pipelines with these utilities.  Example:
+
+> (pid1, x1) <- pipeFrom "ls" ["/etc"]
+> (pid2, x2) <- pipeBoth "grep" ["x"] x1
+> putStr x2
+> ... the grep output is displayed ...
+> forceSuccess pid2
+> forceSuccess pid1
+
+Remember, when you use the functions that return a String, you must not call
+'forceSuccess' until after all data from the String has been consumed.  Failure
+to wait will cause your program to appear to hang.
+
+Here is an example of the wrong way to do it:
+
+> (pid, x) <- pipeFrom "ls" ["/etc"]
+> forceSuccess pid         -- Hangs; the called program hasn't terminated yet
+> processTheData x
+
+You must instead process the data before calling 'forceSuccess'.
+
+When using the hPipe family of functions, this is probably more obvious.
 -}
 
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list