Path: utzoo!utgpu!attcan!uunet!husc6!rutgers!mailrus!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.sys.ibm.pc Subject: Re: Microsoft C Bug or Feature ????? Summary: bug in MS-DOS Message-ID: <3559@bsu-cs.UUCP> Date: 4 Aug 88 15:32:29 GMT References: <8808021504.AA05128@wilson.csri.toronto.edu> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 30 In article <8808021504.AA05128@wilson.csri.toronto.edu> byu@csri.toronto.edu (Benjamin Yu) writes: >I was trying to putc a byte (hex 1A) to stdprn using Microsoft C V4.0. >Since hex 1A is ctrl-Z which stands for end-of-file, the byte is never >sent. This is really a bug in MS-DOS, though it was probably intended as a feature. When sending output to a character-oriented device, a control Z is used to indicate end-of-file too. This isn't necessary, but it happens. So the PRN printer device driver, when it sees control-Z, assumes no more data will arrive and freezes up, refusing to accept any more characters. To see this philosphy in action, try giving MS-DOS this command: echo ^Z If all goes normally, you will see the response "Insufficient disk space". What really happened was that when the console driver saw the control Z, it assumed end-of-file had arrived, and so refused to accept any data. COMMAND.COM realized that the console was refusing to print, and assumed that it couldn't send stuff because of a full disk. A hypothetical solution is to put the printer device into raw mode. You have to write a program to do this. I don't know if it will work for you. -- Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi