Mail Archives: djgpp/1998/04/18/04:46:55
Richard Russell wrote:
>
> I'm sure this is an FAQ, but I can't find the answer in the places I have
> looked. Attempting to redirect the output from printf to a file using '>'
> on the command line, or to pipe it to 'more' with '|', is ineffective. The
> program originates on a Unix platform (compiled with gcc) and redirection
> and piping work OK there. However, when compiled for DOS with DJGPP the
> output appears to go to the screen irrespective of the '>' or '|'.
>
> Richard.
Usually, program output is sent to stdout. That one you can
redirect with > or |. Diagnostic messages should go to
stderr, which you can redirect under UNIX with
foo >2 aa , IIRC.
To do that under COMMAND.COM, you'll need to say
redir -e err.log foo
Unless there is something strange going on in your
program, it should work fine. Check if it does
something like
fclose(stdout);
stdout = fopen("/dev/tty","w");
or something else with stdout.
Without that info it is hard to tell what is going on.
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
altered the 'djgpp.env'
file. Please check the instructions in chapter 8.1 of the FAQ again,
and if those still don't help, post a system report according to chapter
6.12.
--
---------------------------------------------------------------------
| John M. Aldrich | "To be 'matter of fact' about the |
| aka Fighteer I | world is to blunder into fantasy-- |
| mailto:fighteer AT cs DOT com | and dull fantasy at that, as the real|
| http://www.cs.com/fighteer | world is strange and wonderful." -LL |
---------------------------------------------------------------------
- Raw text -