|
Posted by sachin on August 27, 2007, 12:34 am
Please log in for more thread options
>
> .
> .
>
>
>
> > When I use 1st CLIArg statement, CLI.exe remains in while loop and
> > never returns.
>
> It's therefore conceivable that nothing gets written to STDOUT ... or
> rather, it's therefore conceivable that nothing gets written to foo.txt
> (since STDOUT has been redirected to foo.txt).
>
> > When I use 2nd CLI Arg statement, CLI.exe returns with value 1.
>
> > Now here is the scenario what I observed:
> > When I use 1st CLIarg statement there is no output on console and
> > foo.txt
>
> As expected ... or is there something that CLI.exe is doing that makes you
> expect some output even though CLI.exe is stuck in a while loop ?
>
> Incidentally, have you verified that CLI.exe is stuck in the "while loop".
> Maybe it's stuck somewhere else ?
> Have you verified that it's CLI.exe (and not the perl script) that's stuck ?
>
> > When I use 2nd CLIArg statement redirection takes place in foo.txt.
>
> My feeling is that redirection also takes place when you use the 1st arg ...
> but in that case there is simply nothing to redirect.
>
>
>
> > So could anyone tell me that, Is there any condition that executable
> > must return a value for redirecting the STDOUT to a file.
> > If there is no such condition for redirection then what is the problem
> > in my code???
>
> It has taken me a few minutes to work out what you are asking. You want to
> verify that redirection has been successfully achieved, right ?
>
> I think you could do that with:
>
> open STDOUT, '>', "foo.txt" or die "STDOUT has not been redirected: $!";
>
> (as is the usual way to verify that the opening of a filehandle has been
> successful :-)
>
> As I said, I would think that redirection has been successfully achieved
> .... it's probably just that the hang that occurs with the first arg means
> that *nothing* gets output.
>
> Cheers,
> Rob
Hi Rob
I think I am not able to explain my problem properly.
It is known that
1) the hangs occur in CLI.exe and not in perl script.
2) When CLI.exe stucks then also it sends some traces on console(If no
redirection ststement is written).
Now when I use CLI.exe with 1st statement for CLIArg ,it stucks and it
does not redirect the console output in foo.txt.
But when I use without redirection it shows me output on console.
So why am I not getting console output in foo.txt when redirectd in
case of CLI.exe stucks
|