Re: Who has tried run-process in STk-2.1.4 ?

From: Erick Gallesio <>
Date: Mon, 14 Nov 1994 12:47:06 +0000

Here I can't say "hey, look the manual" ;-)

To make running the example you give you have to set the input and output of
your in a pipe (this was the meaning of #t if I remember in the original

:input xxx where xxx is a string subsumes it is a file name
           where xxx = :pipe put it in a pipe.

the same thing apply to :output and :error

:wait admit a parametre which indicates id the jobs is run in background or
(defautl value for :wait is #f)

Hereafter is an example of run-process (output is not redirected)

        (define myprocess (run-process "cat" :input :pipe))
        STk> (process-input myprocess)
        #[output-port 'pipe-input-20565']
        STk> (write 122212 (process-input myprocess) )
        STk> (flush (process-input myprocess))

Following example use also an output redirection

        STk> (define myprocess2 (run-process "cat" :input :pipe :output :pipe))
        STk> (format (process-input myprocess2) "1\n2\n3\n")
        STk> (flush (process-input myprocess2))
        STk> (read (process-output myprocess2))
        STk> (read (process-output myprocess2))
        STk> (read (process-output myprocess2))

Another thing which is not documented for now (and I don't remember if I have
already signaled it here) is that you can use pipe if you put a "|" as the
character of a file name. Hereafer are two examples of its usage:

(with-input-from-file "| ls -ls"
  (lambda ()
    (do ((l (read-line) (read-line)))
        ((eof-object? l))
      (display l)

(with-output-to-file "| mail eg"
    (format #t "This is a simple mail that I send to myself\n")))


                -- Erick

                -- Erick
Received on Mon Nov 14 1994 - 12:47:11 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST