unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Redirecting guile's output to more/less
@ 2002-03-25 22:08 Brett Viren
  2002-03-26  2:55 ` Christopher Cramer
  0 siblings, 1 reply; 2+ messages in thread
From: Brett Viren @ 2002-03-25 22:08 UTC (permalink / raw)


Hello again,

I have a C library which has functions that print to stdout, sometimes
filling several screens.  I would like to somehow redirect this output
temporarily to whatever is in the PAGER env. var.  After the PAGER
quits, then regular interactive guile output should continue to go to
stdout.  

Is it possible?

-Brett.

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: Redirecting guile's output to more/less
  2002-03-25 22:08 Redirecting guile's output to more/less Brett Viren
@ 2002-03-26  2:55 ` Christopher Cramer
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Cramer @ 2002-03-26  2:55 UTC (permalink / raw)
  Cc: guile-user

On Mon, Mar 25, 2002 at 05:08:37PM -0500, Brett Viren wrote:
> I have a C library which has functions that print to stdout, sometimes
> filling several screens.  I would like to somehow redirect this output
> temporarily to whatever is in the PAGER env. var.  After the PAGER
> quits, then regular interactive guile output should continue to go to
> stdout.  
> 
> Is it possible?

It's possible. What you would do is, dup stdout, open a pipe to less,
dup2 it to stdout, wait for less to exit, dup2 the old stdout back.

The default output port for Guile doesn't necessarily have to be stdout,
by the way.

-- 
Christopher Cramer <crayc@pyro.net> <http://www.pyro.net/~crayc/>
Quoi que vous fassiez, écrasez l'infâme, et aimez qui vous aime.
	-- Voltaire

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

end of thread, other threads:[~2002-03-26  2:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-25 22:08 Redirecting guile's output to more/less Brett Viren
2002-03-26  2:55 ` Christopher Cramer

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).