guile-user
[Top][All Lists]
Advanced

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

Re: X11 bindings and shell bindings


From: Neil Jerram
Subject: Re: X11 bindings and shell bindings
Date: Thu, 18 Sep 2008 17:58:25 +0100

2008/9/18  <address@hidden>:
> ---- Ishan Arora <address@hidden> wrote:
>> Hi,
>>
>> Thanks for the reply. I tried system. It calls the code synchronously, and
>> returns a number for success or failure of the command. Is there a way such
>> that the stdout output of the command is returned as a string? Thanks again.
>
> Try open-input-pipe in the (ice-9 popen) module.

That is indeed the best way, with an up to date Guile.  In case you're
stuck with an old one (1.6.x, I think) where open-input-pipe isn't
reliable, you can work around that by doing something like this:

      (system "your-command-here > temp-file.txt")
      (with-input-from-file "temp-file.txt" read-line)

  Neil




reply via email to

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