[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Support for (system '("echo" "foo" "bar"))
From: |
Paul Jarc |
Subject: |
Re: Support for (system '("echo" "foo" "bar")) |
Date: |
Fri, 31 Oct 2003 15:37:21 -0500 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) |
Kevin Ryde <address@hidden> wrote:
> As a suggestion, I think a variation that just returned the child pid
> would be nice (or threw an execption for an exec failure).
(define (system*/nowait . args)
(flush-all-ports)
(let* ((p (pipe))
(pid (primitive-fork)))
(if (zero? pid)
(catch
'system-error
(lambda ()
(close-port (car p))
(fcntl (cdr p) F_SETFD FD_CLOEXEC)
(apply execlp (car args) args))
(lambda exception
(write exception (cdr p))
(force-output (cdr p))
(raise SIGKILL)))
(begin
(close-port (cdr p))
(let ((exception (read (car p))))
(close-port (car p))
(if (not (eof-object? exception))
(apply throw exception)
pid))))))
I'd still prefer the argv list as a single Scheme argument, though,
since it saves an "apply" when the list is dynamically constructed.
paul
- Re: Support for (system '("echo" "foo" "bar")), (continued)
- Re: Support for (system '("echo" "foo" "bar")), Kevin Ryde, 2003/10/31
- Re: Support for (system '("echo" "foo" "bar")), Paul Jarc, 2003/10/31
- Re: Support for (system '("echo" "foo" "bar")), Kevin Ryde, 2003/10/31
- Re: Support for (system '("echo" "foo" "bar")), Paul Jarc, 2003/10/31
- Re: Support for (system '("echo" "foo" "bar")), Jonathan Bartlett, 2003/10/31
- Re: Support for (system '("echo" "foo" "bar")), Kevin Ryde, 2003/10/31
- Re: Support for (system '("echo" "foo" "bar")),
Paul Jarc <=
- Re: Support for (system '("echo" "foo" "bar")), Rob Browning, 2003/10/31