Software Archive
Read-only legacy content
17060 Discussions

Redirecting error messages.

csmythe
Beginner
1,623 Views
I need to capture runtime error messages to a file. The documentation for Fortran says that I can do this with simple redirection, i.e.

c:> foo.exe >>errors.txt

When I try this, error messages still are sent to the console. The file "errors.txt " is created, but is always empty.

How can I get this to work?

Thanks,
Chuck Smythe
0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,623 Views
Try appending "2>&1" (without the quotes) to your command line. This says to redirect standard error to standard output. Note that Windows 9x doesn't accept this.

Steve
0 Kudos
csmythe
Beginner
1,623 Views
Help!

The list of messages indicates that "Steve L." replied to my previous question, but I can't find a way to read this reply, or any other...when I click on the message, it opens the original message, not the reply.

Also, I requested the reply to be e-mailed, and it didn't happen. My user profile looks correct.

Can someone tell me how to read these replies? (Maybe e-mail me, since I don't know how to read your reply!)

Thanks,
Chuck Smythe
csmythe@webaccess.net
0 Kudos
csmythe
Beginner
1,623 Views
Sorry, I need to follow this up again.
I was able to read the replies by using "format for printing". A Netscape problem?
I tried appending 2>&1 to the command line (Win98 machine). It doesn't cause an error message, but now "errors.txt" is not created. Runtime error are still sent to the console.
I need a solution to this that will work under all flavors of Windows. If simple redirection in the DOS environment isn't possible, is there some way to attach stderr, or whatever VF calls it, to an I/O unit within the code, then force that to write to a file on failure? The documentation describes a way to do this for floating point errors, but seems to say that it won't work for other run-time errors.

Thanks,
Chuck
0 Kudos
Steven_L_Intel1
Employee
1,623 Views
Yes, it's Netscape. I've reported the problem. but Netscape 6.x works.

Windows 98 doesn't support this redirection, but on the CVF CD you'll find a USUPPORT folder which contains an EC utility that can be used to get it. Run EC by itself to have it display usage. Early 5.0 CDs didn't have this, so you can also get the utilities from here.

Steve
0 Kudos
Reply