From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.devel Subject: Re: Support for (system '("echo" "foo" "bar")) Date: Fri, 31 Oct 2003 15:37:21 -0500 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87ad7l9i8h.fsf@raven.i.defaultvalue.org> <87u15qpjwk.fsf@zip.com.au> <877k2mgdjs.fsf@raven.i.defaultvalue.org> <87k76lb1oq.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1067632696 23045 80.91.224.253 (31 Oct 2003 20:38:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2003 20:38:16 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Oct 31 21:38:14 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AFg29-0007CJ-00 for ; Fri, 31 Oct 2003 21:38:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFg20-00046j-Nx for guile-devel@m.gmane.org; Fri, 31 Oct 2003 15:38:04 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AFg1w-00046V-6x for guile-devel@gnu.org; Fri, 31 Oct 2003 15:38:00 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AFg1P-0003nj-7b for guile-devel@gnu.org; Fri, 31 Oct 2003 15:37:59 -0500 Original-Received: from [129.22.104.63] (helo=harris.CNS.CWRU.Edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFg1O-0003n1-Rr for guile-devel@gnu.org; Fri, 31 Oct 2003 15:37:26 -0500 Original-Received: from conversion-daemon.smtp-a.cwru.edu by smtp-a.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) id <0HNN00H012HMQM@smtp-a.cwru.edu> for guile-devel@gnu.org; Fri, 31 Oct 2003 15:37:21 -0500 (EST) Original-Received: from multivac.cwru.edu (multivac.ITS.CWRU.Edu [129.22.114.26]) by smtp-a.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HNN00GX12M9K4@smtp-a.cwru.edu> for guile-devel@gnu.org; Fri, 31 Oct 2003 15:37:21 -0500 (EST) Original-Received: (qmail 6770 invoked by uid 500); Fri, 31 Oct 2003 20:37:43 +0000 In-reply-to: <87k76lb1oq.fsf@zip.com.au> Original-To: guile-devel@gnu.org Mail-followup-to: guile-devel@gnu.org Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) Original-Lines: 32 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2946 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2946 Kevin Ryde 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 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel