guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: execlp


From: Paul Emsley
Subject: Re: execlp
Date: Wed, 23 Nov 2011 12:16:47 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b2 Thunderbird/3.1.11

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 <address@hidden <mailto:address@hidden>> 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.









reply via email to

[Prev in Thread] Current Thread [Next in Thread]