Path: utzoo!utgpu!attcan!uunet!husc6!bloom-beacon!apple!voder!kontron!optilink!cramer From: cramer@optilink.UUCP (Clayton Cramer) Newsgroups: comp.sys.ibm.pc Subject: Re: Microsoft C Bug or Feature ????? Message-ID: <334@optilink.UUCP> Date: 5 Aug 88 16:23:38 GMT References: <8808021504.AA05128@wilson.csri.toronto.edu> <3559@bsu-cs.UUCP> Organization: Optilink Corporation, Petaluma, CA Lines: 36 In article <3559@bsu-cs.UUCP>, dhesi@bsu-cs.UUCP (Rahul Dhesi) writes: > 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. > > 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. > > 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 Use the setmode(fileno(stdprn), O_BINARY) call to put stdprn into raw mode from C. Clayton E. Cramer [I hate the 50% rule]