Re: ROOT/CINT problem ?

Masaharu Goto (gotom@hpyiddq.jpn.hp.com)
Wed, 18 Jun 1997 10:32:44 JST


Rooters,

Maybe I need to clean up the redirection implementation. There are a
couple of different implementation right now. They Look alike but
different in fundament.

1) CINT redirection
CINT is emulating I/O redirection by '>' '2>' '>>' '2>>' and '<'
command. But in fact, these are not true redirection. CINT maintains
it's-own stdio pointers. If you use these commands as follows, CINT
swaps these pointers and make connection to files. Inside CINT,
I'm only using fopen() to do so.
Nice part of this implementation is that, this won't be affected by
anything because it's a simple fopen().
Drawback is that, in this method, you can only dump output from the
interpreter. Output from compiled code can't be dumpped.

root[0] .> filename
root[1] DoMyJob()
root[2] .>

root[3] .< filename

2) stdio freopen() redirection
Another kind of implementation, I'm using freopen() to redirect stdio
from the fundament. If you add '> filename' '2> filename' '>> filename'
'2>> filename' or '< filename' after arbitrary ROOT command, stdio can
be redirected. In this case, output from compiled code can also be
dumpped.
Drawback is that if another redirection is done somewhere in the system,
it might break everything.

root[0] DoMyJob() > filename

I think this is a good chance to bring up this subject. This implementation
will be kept for the time being. I'll appreciate any comment about this.

Masaharu Goto

> Hi Nick,
>
> I think that the problem of redirection in CINT/ROOT
> is the following:
>
> ROOT/CINT uses instead of stdout Motif interface.
> You can not even use dumb terminal for ROOT.
>
> But there is special command for redirection
>
> .> filename
>
> Cheers Victor