Re: [ROOT] redirecting stdout, stderr

From: Frederic Sarazin (sarazin@triumf.ca)
Date: Wed Mar 20 2002 - 23:25:11 MET


Dear Rooters,

Add-on to my mail from yesterday.

http://root.cern.ch/root/roottalk/roottalk02/1293.html


I looked carefully in the ROOT digest and one
of the things that is suggested is to redirect stdout from cint.

.>[filename1] for stdout
.2>[filename2] for stderr

This works (if filename1<>filename2 apparently, otherwise there are funny
things happening).

However, if one has to use gROOT->ProcessLine() to enter the commands
(GUI case),
I found the following problem:


root [0] gROOT->ProcessLine(".>filename")      //stdout redirected to
filename
Output will be saved in file filename! ('>' to display on screen)

root [1] .x Start.C // start a test script (not a GUI)

root [2] gPad         // redirection okay !

root [3] gROOT->ProcessLine("gPad")    // redirection failed !
(class TPad*)0x8781078


Moreover, as it has been previously written:

http://root.cern.ch/root/roottalk/roottalk00/3248.html

it seems that freopen("filename","w",stdout) doesn't redirect stdout in my
file.

Please HELP !!!

Fred



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:46 MET