Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ptsfa!ihnp4!ihlpl!psfales From: psfales@ihlpl.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: ioctl on msdos device drivers Message-ID: <1989@ihlpl.ATT.COM> Date: Mon, 13-Apr-87 19:40:02 EST Article-I.D.: ihlpl.1989 Posted: Mon Apr 13 19:40:02 1987 Date-Received: Wed, 15-Apr-87 03:18:56 EST References: <959@rocksvax.UUCP> <4490002@hpcvck.HP> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 31 Summary: Depends on C compiler In article <4490002@hpcvck.HP>, scott@hpcvck.HP (Scott Linn) writes: > I would also be interested in what people have to say about > setting ioctl for devices like printers. I have been trying > to write a graphics dump routine for my MSDOS computer (not IBM > compatible), and was having trouble. I was opening the printer > as a binary device, but MSDOS was *not* treating like a binary > device/file. If I wrote the info to a file first, then did > COPY PRN: /B, it printed the info fine. I don't know about your particular C compiler, but I just discovered a couple of days ago how to do it en ECO-C88. It turns out that most of the stuff you want binary mode for (CR to CR/NL translation, 8th bit stripping, etc.) is handled by the compiler library read and write routines. For files opened by the program, the file may be opened in binary mode, but for the preopened files like stdin and stdout you don't have this choice. There are a set of flags in the file descriptor that the read and write routines look at to determine what modes are currently in effect. In my case, I can change stdout to binary mode by setting stdout->_flag |= _BFLAG. Note that this has works independently of the driver RAW mode. In your case, I suspect the write routines are buggy and are still performing some translations even though the file is asked to be open in raw mode. Do you have access to another compiler? -- Peter Fales UUCP: ...ihnp4!ihlpl!psfales work: (312) 979-7784 AT&T Information Systems, IW 1Z-243 1100 E. Warrenville Rd., IL 60566