guile-user
[Top][All Lists]
Advanced

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

Re: How to read a string output with `open-input-pipe` on Mac OS?


From: tomas
Subject: Re: How to read a string output with `open-input-pipe` on Mac OS?
Date: Tue, 10 Oct 2023 06:31:23 +0200

On Mon, Oct 09, 2023 at 05:49:09PM -0700, Panisuan Chasinga wrote:
> Hi list, I want to read a string output using `ice-9/popen/open-input-pipe`
> but somehow always got an empty string. Here is my test code:
> 
> 
> (use-modules (ice-9 popen))
> (use-modules (ice-9 textual-ports))
> 
> (define (test-read-port)
>   (let* ((port (open-input-pipe "ls"))
>            (str (get-string-all p)))
>      (close-port p)
>      str))

I guess you have a typo there: when opening, your port is called `port',
later you use `p'.

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

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