unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#43364: Possible bug with output redirection
@ 2020-09-12 20:59 pinoaffe
  2020-09-13  7:13 ` tomas
  0 siblings, 1 reply; 2+ messages in thread
From: pinoaffe @ 2020-09-12 20:59 UTC (permalink / raw)
  To: 43364

Dear guilers,

When using with-output-to-string, the output of external processes
started using system* and the like is not redirected to the temporary
port. As far as I can tell, it just redirects things written/displayed
from within guile.
This seems to be a bug, or if this is intended behaviour it might be
beneficial to document this somewhere.

As an example:
I'd expect snippet [0] to behave like snippet [1] and return "bar",
instead it just returns the empty string.

This probably affects other similar functions.

Pandemically,
pinoaffe

[0]:
(with-output-to-string
 (lambda ()
   (system* "echo" "bar")))

[1]:
(with-output-to-string
 (lambda ()
   (display "bar")))





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#43364: Possible bug with output redirection
  2020-09-12 20:59 bug#43364: Possible bug with output redirection pinoaffe
@ 2020-09-13  7:13 ` tomas
  0 siblings, 0 replies; 2+ messages in thread
From: tomas @ 2020-09-13  7:13 UTC (permalink / raw)
  To: 43364

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

On Sat, Sep 12, 2020 at 10:59:23PM +0200, pinoaffe wrote:
> Dear guilers,
> 
> When using with-output-to-string, the output of external processes
> started using system* and the like is not redirected to the temporary
> port. As far as I can tell, it just redirects things written/displayed
> from within guile.
> This seems to be a bug, or if this is intended behaviour it might be
> beneficial to document this somewhere.

I think this is intentional (or rather: out of Guile's scope). While the
Guile process's output functions are the scope of `with-output-to-string',
the subprocess started with `system' just happens to inherit the standard
output file descriptor, which is an operating system mechanism.

No idea, for example, about what would happen under Windows or other
(more or less) operating systems.

But you are right that it can be a bit confusing. I'm not sure whether a
hint in the doc would be in place.

What do oters think?

Cheers
-- t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-13  7:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-12 20:59 bug#43364: Possible bug with output redirection pinoaffe
2020-09-13  7:13 ` tomas

unofficial mirror of bug-guile@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-bugs/0 guile-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-bugs guile-bugs/ https://yhetil.org/guile-bugs \
		bug-guile@gnu.org
	public-inbox-index guile-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.bugs
	nntp://news.gmane.io/gmane.lisp.guile.bugs


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git