From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Diogo F. S. Ramos" Newsgroups: gmane.lisp.guile.user Subject: Re: What is the output port of `system*'? Date: Sun, 27 Apr 2014 16:27:48 -0300 Message-ID: <87lhuqfu8b.fsf@nebulosa.milkyway> References: <87mwf7hnly.fsf@nebulosa.milkyway> <87siozn2e7.fsf@taylan.uni.cx> <87zjj7fifp.fsf@nebulosa.milkyway> <87lhur8fs6.fsf@yeeloong.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1398626914 21630 80.91.229.3 (27 Apr 2014 19:28:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Apr 2014 19:28:34 +0000 (UTC) Cc: guile-user@gnu.org To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Apr 27 21:28:27 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WeUkT-0001yr-KW for guile-user@m.gmane.org; Sun, 27 Apr 2014 21:28:25 +0200 Original-Received: from localhost ([::1]:40353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeUkT-0000fp-7d for guile-user@m.gmane.org; Sun, 27 Apr 2014 15:28:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeUkE-0000fT-5L for guile-user@gnu.org; Sun, 27 Apr 2014 15:28:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WeUk8-0005DU-0i for guile-user@gnu.org; Sun, 27 Apr 2014 15:28:10 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:47531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeUk7-0005DN-R8 for guile-user@gnu.org; Sun, 27 Apr 2014 15:28:03 -0400 Original-Received: from fulvetta.riseup.net (fulvetta-pn.riseup.net [10.0.1.75]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Gandi Standard SSL CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4A83A4D054; Sun, 27 Apr 2014 12:28:03 -0700 (PDT) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dfsr@fulvetta.riseup.net) with ESMTPSA id 507B1320 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Virus-Scanned: clamav-milter 0.98.1 at mx1 X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 198.252.153.129 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11238 Archived-At: >> As an example of this behavior, I point to the following Racket program: >> >> #lang racket >> >> (define foo >> (with-output-to-string >> (lambda () >> (system* (find-executable-path "ls") "/tmp")))) > > I agree that it would be nice to make this work as you expected. In > order to handle ports that are not simply raw POSIX file descriptors > (e.g. string ports), we'd need to create a pipe behind the scenes, and > arrange for thread(s) in the current process to copy data between the > pipe(s) and the Scheme port. > > I'd like to do this at some point, although for the sake of backward > compatibility we'd probably have to leave 'system' and 'system*' as-is > and create a new API that works more intuitively. If you do, may I suggest taking a look at Racket's Processes? I'm not aware of things like "custodian" or "synchromizable event" in Guile, but I've used Racket's Processes successfully in the past.