RE:[Fwd: [ROOT] redirect cout]

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Sat Apr 28 2001 - 12:43:05 MEST


Hello Valery and Fons,

Yes, I know this.

Output redirection is implemented in Cint. This works fine in
most of the case, however, with some platform (ie, Windows), 
things like this does not work. Here is the reason why.

On UNIX,  redirection is inherited to a child process. When
you do  'root[0] .ls' or 'root[0] gDirectory->ls()'  child process
is invoked to do the real job. And output from the child process
is also redirected.

However, on Windows, child process does not inherit the redirection.
When command like this is invoked, child process outputs its result
in display.  This is why output from those commands are not redirected.

I tried several things using CreateProcess Win32API. It has arguments
about stdio handles. So far, I am  unable to make it work. If anybody
has any idea, please let me know.

Thank you
Masaharu Goto


>Date: Fri, 27 Apr 2001 12:09:22 -0500
>From: Valeriy Onuchin <onuchin@fnal.gov>
>Reply-To: onuchin@fnal.gov
>To: Fons Rademakers <Fons.Rademakers@cern.ch>
>Cc: roottalk@pcroot.cern.ch
>Subject: Re: [ROOT] redirect cout
>
> Hi Fons,
>I can't understand why the following isn't redirected?
>
>root [0] .> aap
>root [1] gDirectory->ls();
>
>Regards.    Valeriy
>
>
>Fons Rademakers wrote:
>
>> Hi Valeriy,
>>
>> this works fine
>>
>> // a.C
>> {
>>    cout << "Valeriy" << endl;
>>    printf("Onuchin\n");
>> }
>>
>> root[] .x a.C > aap
>>
>> both go into aap.
>>
>> -- Fons
>>
>> Valeriy Onuchin wrote:
>> >
>> > Hi,
>> > to redirect stdout I'm using "root[].> file.out".
>> > That doesn't make any effect to "cout output".
>> >
>> > I would like to redirect both cint's stdout and cout
>> > to the same file.  Help!
>> >
>> > Thanks.    Regards.    Valeriy
>>
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:43 MET