From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.user Subject: Re: execlp Date: Wed, 23 Nov 2011 20:22:08 +0800 Message-ID: References: <4ECBC87E.7090000@bioch.ox.ac.uk> <4ECCE42F.8030404@bioch.ox.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf30781180f35a6804b265f747 X-Trace: dough.gmane.org 1322050949 14645 80.91.229.12 (23 Nov 2011 12:22:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2011 12:22:29 +0000 (UTC) Cc: guile-user@gnu.org To: Paul Emsley Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Nov 23 13:22:25 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RTBqJ-0002rd-Pj for guile-user@m.gmane.org; Wed, 23 Nov 2011 13:22:24 +0100 Original-Received: from localhost ([::1]:58374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBqA-0005JM-1F for guile-user@m.gmane.org; Wed, 23 Nov 2011 07:22:14 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBq6-0005Ix-5U for guile-user@gnu.org; Wed, 23 Nov 2011 07:22:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTBq4-0001R7-VA for guile-user@gnu.org; Wed, 23 Nov 2011 07:22:10 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:56304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBq4-0001Qx-LK for guile-user@gnu.org; Wed, 23 Nov 2011 07:22:08 -0500 Original-Received: by vbbfn1 with SMTP id fn1so1426706vbb.0 for ; Wed, 23 Nov 2011 04:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=R6PvRgiwcEQ+fogOe55WWg+N6sN/8yqpEv1qBzaM9RQ=; b=NjecryfOfFngCGNcrR3Cbq7596mZQKoSA0G41QqgmEJ11us6hedGhKuSfFjtu49dib ZvZSJIwmIPpPjoAito+5CNWDtZ1Y/9g1km1MH5QfcingrEOHMkzg69vjz69EZd/gZOjP imkSo9yvDN9lT+vaz2wFKSBnNmJob9hIiczjU= Original-Received: by 10.52.25.75 with SMTP id a11mr25327389vdg.1.1322050928204; Wed, 23 Nov 2011 04:22:08 -0800 (PST) Original-Received: by 10.52.31.165 with HTTP; Wed, 23 Nov 2011 04:22:08 -0800 (PST) In-Reply-To: <4ECCE42F.8030404@bioch.ox.ac.uk> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.41 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:8979 Archived-At: --20cf30781180f35a6804b265f747 Content-Type: text/plain; charset=UTF-8 Well, I'm glad to help. ;-) And I think any "Segment Fault" must be a bug. So I sent a letter for this in guile-dev. On Wed, Nov 23, 2011 at 8:16 PM, Paul Emsley wrote: > Hi Nala Ginrut, > > Thanks for your reply. > > I suspect I expressed myself poorly. (execlp "ls" "") replaces guile with > "ls", which lists my files and returns me to the shell. > > What is some-function, where some-function works like this: > > (some-function "ls") > -> "/bin/ls" (I'd settle for #t") > (some-function "asdfasdf") > -> #f > > I thought that execl or its friends would be the way to answer that > question... > > Thanks, > > Paul. > > > > On 23/11/11 05:47, Nala Ginrut wrote: > >> I think there's a bug. >> (execlp "ls" "") will access. >> Since the second parameter is optional, scm_execlp doesn't handle >> exec_argv unbounded situation. >> >> >> On Wed, Nov 23, 2011 at 12:06 AM, Paul Emsley > paul.emsley@bioch.ox.**ac.uk >> wrote: >> >> >> Hi, >> >> I am trying to see if there is a way to determine if a program is >> in the path (i.e. a bit like "which"), returning a #t or #f >> answer. I was looking execl and execlp. >> >> The documentation for execl says: >> >> > Executes the file named by path as a new process image >> >> what is path ? I'm guessing that that should be "filename". >> >> While playing around, I notice that >> >> (execlp "ls") >> >> produces a core dump. >> >> My question is then, *is* there a way to determine if a string is >> executable? (And if so, how? :-) >> >> Thanks, >> >> Paul. >> >> >> >> >> >> > > --20cf30781180f35a6804b265f747 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Well, I'm glad to help. ;-)
And I think any "Segment Fault&quo= t; must be a bug. So I sent a letter for this in guile-dev.

On Wed, Nov 23, 2011 at 8:16 PM, Paul Emsley <paul.emsley@bioc= h.ox.ac.uk> wrote:
Hi Nala Ginrut,

Thanks for your reply.

I suspect I expressed myself poorly. (execlp "ls" "") r= eplaces guile with "ls", which lists my files and returns me to t= he shell.

What is some-function, where some-function works like this:

(some-function "ls")
-> "/bin/ls" =C2=A0(I'd settle for #t")
(some-function "asdfasdf")
-> #f

I thought that execl or its friends would be the way to answer that questio= n...

Thanks,

Paul.



On 23/11/11 05:47, Nala Ginrut wrote:
I think there's a bug.
(execlp "ls" "") will access.
Since the second parameter is optional, scm_execlp doesn't handle exec_= argv unbounded situation.


On Wed, Nov 23, 2011 at 12:06 AM, Paul Emsley <paul.emsley@bioch.ox.ac.uk <m= ailto:paul.= emsley@bioch.ox.ac.uk>> wrote:


=C2=A0 =C2=A0Hi,

=C2=A0 =C2=A0I am trying to see if there is a way to determine if a progra= m is
=C2=A0 =C2=A0in the path (i.e. a bit like "which"), returning a = #t or #f
=C2=A0 =C2=A0answer. =C2=A0I was looking execl and execlp.

=C2=A0 =C2=A0The documentation for execl says:

=C2=A0 =C2=A0> Executes the file named by path as a new process image
=C2=A0 =C2=A0what is path ? =C2=A0I'm guessing that that should be &qu= ot;filename".

=C2=A0 =C2=A0While playing around, I notice that

=C2=A0 =C2=A0(execlp "ls")

=C2=A0 =C2=A0produces a core dump.

=C2=A0 =C2=A0My question is then, *is* there a way to determine if a strin= g is
=C2=A0 =C2=A0executable? (And if so, how? :-)

=C2=A0 =C2=A0Thanks,

=C2=A0 =C2=A0Paul.








--20cf30781180f35a6804b265f747--