guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redirecting guile's output to more/less


From: Christopher Cramer
Subject: Re: Redirecting guile's output to more/less
Date: Mon, 25 Mar 2002 20:55:01 -0600
User-agent: Mutt/1.2.5i

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 <address@hidden> <http://www.pyro.net/~crayc/>
Quoi que vous fassiez, écrasez l'infâme, et aimez qui vous aime.
        -- Voltaire



reply via email to

[Prev in Thread] Current Thread [Next in Thread]