[Haskell-beginners] How to wait till a process is finished before invoking the next one?

Daniel Fischer daniel.is.fischer at web.de
Thu May 7 13:10:49 EDT 2009


Am Donnerstag 07 Mai 2009 18:36:08 schrieb Thomas Friedrich:
> Hi everyone,
>
> Each of the above function take a list of filenames, run certain
> command-line programs on them, which I invoke by runCommand, and each of
> them produce multiple output-files.  Each function in main needs a
> couple of those output-files that are produced by the function directly
> above it.  How do I get Haskell to wait, till all the data is written to
> the disk, before invoking the next command.

System.Process.waitForProcess

should do it, conveniently runCommand returns a ProcessHandle.

> The way the program is
> currently written, Haskell doesn't see that the input of one function
> depends on the output of another, and tries to run them all at the same
> time.
>
> Any ideas?
>
> Thanks everyone for your help.
>
> Cheers,
> Thomas




More information about the Beginners mailing list