| 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.
|