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 13:47:04 +0800 Message-ID: References: <4ECBC87E.7090000@bioch.ox.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf307811801fa8c604b2607338 X-Trace: dough.gmane.org 1322027237 21108 80.91.229.12 (23 Nov 2011 05:47:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2011 05:47:17 +0000 (UTC) To: Paul Emsley , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Nov 23 06:47:13 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 1RT5fs-0007W8-VJ for guile-user@m.gmane.org; Wed, 23 Nov 2011 06:47:13 +0100 Original-Received: from localhost ([::1]:49641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT5fr-0001e3-R0 for guile-user@m.gmane.org; Wed, 23 Nov 2011 00:47:11 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT5fn-0001dv-8R for guile-user@gnu.org; Wed, 23 Nov 2011 00:47:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RT5fm-0000ag-4H for guile-user@gnu.org; Wed, 23 Nov 2011 00:47:07 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:41215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT5fl-0000aX-Sz for guile-user@gnu.org; Wed, 23 Nov 2011 00:47:05 -0500 Original-Received: by vbbfn1 with SMTP id fn1so1110852vbb.0 for ; Tue, 22 Nov 2011 21:47:05 -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 :content-type; bh=C1gpmwq17CfRX/mRIQJpTZoM+rv3kBir0joQ7qBdztA=; b=lmmLFaAo9NRn/naZOQzW00w4QdIPrvoPpCsDAPHCkkeQOv9VmzNd3oxntrybAT+Nk4 tI3ywxTWGrZsA4SVuolCBhnhMdfFcvMddc3ydsPsNINulDMyP/5C349P99JzaIUsXlc7 x4rHtiTPCeQCTwWmbHpaVqmCQwCM3OaRdUe0w= Original-Received: by 10.52.25.75 with SMTP id a11mr24034425vdg.1.1322027224901; Tue, 22 Nov 2011 21:47:04 -0800 (PST) Original-Received: by 10.52.31.165 with HTTP; Tue, 22 Nov 2011 21:47:04 -0800 (PST) In-Reply-To: <4ECBC87E.7090000@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:8976 Archived-At: --20cf307811801fa8c604b2607338 Content-Type: text/plain; charset=UTF-8 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 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. > > > > > --20cf307811801fa8c604b2607338 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I think there's a bug.
(execlp "ls" "&quo= t;) will access.
Since the second parameter is optional, scm_exec= lp 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 pa= th (i.e. a bit like "which"), returning a #t or #f answer. =C2=A0= 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 ? =C2=A0I'm guessing that that should be "filename&qu= ot;.

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 executabl= e? (And if so, how? :-)

Thanks,

Paul.





--20cf307811801fa8c604b2607338--