guile-user
[Top][All Lists]
Advanced

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

Re: execlp


From: Nala Ginrut
Subject: Re: execlp
Date: Wed, 23 Nov 2011 20:28:56 +0800



On Wed, Nov 23, 2011 at 8:16 PM, Paul Emsley <address@hidden> 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...


I think there's no such a given function in Guile to do this.
But you can make it in a easy way in Guile:
(catch 'system-error  
    (lambda () (execlp "asdfasdf")) 
      (lambda (k . e) 
         (format #t "oh no~%~")))

PS: Maybe you need #f instead of "format" according to your letter. ;-)


reply via email to

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