From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: Stderr redirection problems Date: 12 Jul 2002 16:36:30 GMT Organization: Ericsson Erisoft AB, Sweden Lines: 29 Message-ID: References: <36F74B8910ED2E4AB98A2E8829085F151740 AT email2k DOT compuweigh DOT com> <1026239617 DOT 616997 AT queeg DOT ludd DOT luth DOT se> NNTP-Posting-Host: lws256.lu.erisoft.se X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Alex Oleynikov (alex AT compuweigh DOT com) wrote: : MartinS wrote: : > : Well, I cannot have COM3 open internally for both stderr and my : > : application's output at the same time, right? : > : Maybe you could suggest some other way of printing the crash dump : > : without using redir? : > : > How about only printing to stderr and let redir direct it to COM3? : Impossible due to specific regulations in the industry - this area has a lot : of rules and regulations especially about the audit printing of the weighing : process, which is supervised by the government. Therefore I need to have a : direct connection with the printer in order to recognize "Off-line" or "Out : of paper" conditions etc. Ok. How about adding a file system extension (FSEXT) that handles the device (say you name it "my_prn") and then you open it and fprintf() as usual to it. In the extension you use the serial comm. library (which name I've forgotten right now) and detect if something goes wrong and set errno accordingly and return -1? By the way, if that printer is the only output you got for error dumps what do you do when the printer signals out of paper? (Print a an error message..., oops the printer isn't working!) Right, MartinS