GNU bug report logs - #43364
Possible bug with output redirection

Previous Next

Package: guile;

Reported by: pinoaffe <pinoaffe <at> airmail.cc>

Date: Sat, 12 Sep 2020 21:00:02 UTC

Severity: normal

Full log


Message #11 received at 43364 <at> debbugs.gnu.org (full text, mbox):

From: Felix Lechner <felix.lechner <at> lease-up.com>
To: 43364 <at> debbugs.gnu.org
Cc: pinoaffe <pinoaffe <at> airmail.cc>
Subject: with-output-to-port works with file ports
Date: Fri, 8 Sep 2023 10:53:00 -0700
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




This bug report was last modified 1 year and 50 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.