From: <tomas@tuxteam.de>
To: guile-user@gnu.org
Subject: Re: How to read a string output with `open-input-pipe` on Mac OS?
Date: Tue, 10 Oct 2023 06:31:23 +0200 [thread overview]
Message-ID: <ZSTTm5gFso8vQejB@tuxteam.de> (raw)
In-Reply-To: <CADvidhHY4fnnE_RMCg-j9giuo5NaNo1CeYWPy2kYb6p7xqAEmg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 555 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2023-10-10 4:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 0:49 How to read a string output with `open-input-pipe` on Mac OS? Panisuan Chasinga
2023-10-10 4:31 ` tomas [this message]
2023-10-10 10:41 ` Zelphir Kaltstahl
2023-10-10 23:07 ` Panisuan Chasinga
[not found] <FA53E38F-EED0-463E-9A51-BF07AAB5718C@fil.org>
2023-10-11 4:21 ` tomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZSTTm5gFso8vQejB@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).