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:57:33 +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=20cf307f3b2e9eee4904b26098a9 X-Trace: dough.gmane.org 1322027867 24401 80.91.229.12 (23 Nov 2011 05:57:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2011 05:57:47 +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:57:43 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 1RT5q1-0001UD-My for guile-user@m.gmane.org; Wed, 23 Nov 2011 06:57:41 +0100 Original-Received: from localhost ([::1]:41503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT5q1-00035w-2M for guile-user@m.gmane.org; Wed, 23 Nov 2011 00:57:41 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:50032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT5pv-00035j-MH for guile-user@gnu.org; Wed, 23 Nov 2011 00:57:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RT5pu-0002HZ-MH for guile-user@gnu.org; Wed, 23 Nov 2011 00:57:35 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:57757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT5pu-0002HR-I7 for guile-user@gnu.org; Wed, 23 Nov 2011 00:57:34 -0500 Original-Received: by vbbfn1 with SMTP id fn1so1114880vbb.0 for ; Tue, 22 Nov 2011 21:57:34 -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=gzCAKflIVYcx5zBGJ2Xut/41ISh5Hns66tq953eTpMU=; b=aglzULKyKmKWDLaQN0eXHtoA5tilHQGbQzwHMU86sWZzFSxM6ZL2fzTZls8QNjMm+1 RfMzMHw2U0v0lvYbUAl/dDAo2uts5cs2UWuK3EGuocEeLrTL4dCWsKkH60nEEusVCctG R9oUNdWSoQu9eR1v//jIlBRRitfuYaztbNa0w= Original-Received: by 10.52.35.75 with SMTP id f11mr23992849vdj.18.1322027853999; Tue, 22 Nov 2011 21:57:33 -0800 (PST) Original-Received: by 10.52.31.165 with HTTP; Tue, 22 Nov 2011 21:57:33 -0800 (PST) In-Reply-To: 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:8977 Archived-At: --20cf307f3b2e9eee4904b26098a9 Content-Type: text/plain; charset=UTF-8 Well, I noticed your second question. ;-) The common method to determine a executable file is stat:perms, you may check it out in the manual for details. On Wed, Nov 23, 2011 at 1:47 PM, 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 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. >> >> >> >> >> > --20cf307f3b2e9eee4904b26098a9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Well, I noticed your second question. ;-)
The common method to determin= e a executable file is stat:perms, you may check it out in the manual for d= etails.

On Wed, Nov 23, 2011 at 1:47 PM, = Nala Ginrut <n= alaginrut@gmail.com> 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 s= ituation.


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.






--20cf307f3b2e9eee4904b26098a9--