unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Felix Lechner via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <bug-guile@gnu.org>
To: 43364@debbugs.gnu.org
Cc: pinoaffe <pinoaffe@airmail.cc>
Subject: bug#43364: with-output-to-port works with file ports
Date: Fri, 8 Sep 2023 10:53:00 -0700	[thread overview]
Message-ID: <CAFHYt54Bd1RXJ3rzq8d9_kAHF0FUrAFqbMzNp2zCbCjptGo2EQ@mail.gmail.com> (raw)
In-Reply-To: <20200912225923.5fa9504e@airmail.cc>

Hi,

In an interesting (or perhaps maddening) inconsistency,
'with-output-to-port' captures stdout from system* here

(call-with-output-file "/tmp/test.log"
  (lambda (port)
    (with-output-to-port
      port
      (lambda ()
        (system* "mktemp" "-d")))))

but 'with-output-to-string' does not do so here

(with-output-to-string
  (lambda ()
    (system* "mktemp" "-d")))

According to lloda on #guile, system* handles the redirection only
when the current ports are file ports. Thanks for that pointer!

Kind regards
Felix





  parent reply	other threads:[~2023-09-08 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12 20:59 bug#43364: Possible bug with output redirection pinoaffe
2020-09-13  7:13 ` tomas
2023-09-08 17:53 ` Felix Lechner via Bug reports for GUILE, GNU's Ubiquitous Extension Language [this message]
2023-09-08 19:06   ` bug#43364: with-output-to-port works with file ports Ricardo Wurmus
2024-04-23 16:32 ` Fabio Natali
2024-04-24  7:00   ` Tony Garnock-Jones

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=CAFHYt54Bd1RXJ3rzq8d9_kAHF0FUrAFqbMzNp2zCbCjptGo2EQ@mail.gmail.com \
    --to=bug-guile@gnu.org \
    --cc=43364@debbugs.gnu.org \
    --cc=felix.lechner@lease-up.com \
    --cc=pinoaffe@airmail.cc \
    /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).