For Programmers: Free Programming Magazines  


Home > Archive > Fortran > May 2006 > Re: gfortran: cannot redirect output (errors and warnigns) )with









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: gfortran: cannot redirect output (errors and warnigns) )with
Brooks Moses

2006-05-25, 7:04 pm

gabsata@gmail.com wrote:
> When I compile my code and try to redirect all the errors and warnings
> from the screen to a file using ">file" in ms-dos. e.g. gfortran
> funcion.f90>file.txt
>
> I get an empty file, and the errors and warnings of the compiler just
> appear on the screen.


This indicates that the errors and warnings of the compiler are getting
sent to standard error, not standard output. Thus, the ">" operator
does not redirect them, as it only redirects standard output.

To redirect standard error in the DOS shell, use the "2>" operator
instead of the ">" operator, like so:

gfortran function.f90 2>file

This is a DOS shell thing that has nothing to do with gfortran, really,
but is something that occurs for any program that prints its output to
the standard error stream.

- Brooks


--
The "bmoses-nospam" address is valid; no unmunging needed.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com