[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Retrieve output from command
From: |
Dale P. Smith |
Subject: |
Re: Retrieve output from command |
Date: |
Tue, 31 Jul 2001 12:28:12 -0400 |
"Dale P. Smith" wrote:
>
> Manuel Giraud wrote:
> >
> > I'm trying to get the result of the command "ls" in a list, for
> > example :
> > (define l (system->list "ls"))
> >
> > I've tried 'system' but it doesn't work since it returns the exit code
> > of the command. Maybe, I will be able to do that using port, but maybe
> > there's already a library to do such things.
>
> Try something like:
>
> (use-modules (ice-9 popen))
>
> (define foo (open-input-pipe "ls")
> (read foo)
> (read foo)
> (close-pipe foo)
Also look at http://www.glug.org/people/ttn/software/ttn-pers-scheme/
for shell-command-to-string.scm
-Dale
--
Dale P. Smith
Treasurer, Cleveland Linux Users Group http://cleveland.lug.net
Senior Systems Consultant, Altus Technologies Corporation
address@hidden
440-746-9000 x309