Browse Prior Art Database

Method for Redirecrting STDERR Output in DOS

IP.com Disclosure Number: IPCOM000105919D
Original Publication Date: 1993-Sep-01
Included in the Prior Art Database: 2005-Mar-20
Document File: 2 page(s) / 45K

Publishing Venue

IBM

Related People

Spelce, DC: AUTHOR [+2]

Abstract

Disclosed is a method for redirecting DOS program output written to the STEDDER device to the STDOUT device. Redirection of output written to the STEDDER device is not possible in DOS. This limitation is restrictive in cases when collection of the program output, such as, to a file is desired.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 70% of the total text.

Method for Redirecrting STDERR Output in DOS

      Disclosed is a method for redirecting DOS program output
written to the STEDDER device to the STDOUT device.  Redirection of
output written to the STEDDER device is not possible in DOS.  This
limitation is restrictive in cases when collection of the program
output, such as, to a file is desired.

      The disclosed program named ERROUT.EXE redirects the STEDDER
file handle to the same file or output device as the STDOUT file
handle, then sends the command to the DOS command processor to be
executed.  All program output written to STDERR will then be sent to
the same file withwhich the STDOUT file handle is associated.

      The following is the program algorithm:

1.  Create a new handle pointing to the STDERR file handle.

2.  Force the STDERR file handle to refer to the same file as the
    STDOUT file handle.

3.  Parse the command-line arguments.

4.    Send the program and arguments to the command processor for
    execution -- any STDERR output will now be written to the STDOUT
    device.

5.  When the program completes execution, force the STDERR file
    handle to refer to it's original output device.

      To illustrate the method, if the DOS command:

TYPE FILE.DAT >LOG.DAT
generated a DOS error message, the file "LOG.DAT" would not be
created since the error message (such as "File not Found") is written
to the STDERR output device.  The greater-than sign(>) does not
redirect o...