🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3915

Re: Microsoft C ver 5.0 ???

#3915
From: Otto J. Makela
Date: Fri, 14 Dec 1990 15:49
22 lines
1976 bytes
In article <1990Dec13.165542.21022@magnus.ircc.ohio-state.edu> sbbrown@magnus.ircc.ohio-state.edu (Stephen B. Brown) writes:
[MicroS*t C 5.0 bugs]
       1. It is impossible to send a '\032' character to a device, even if
   it was open'ed in 'O_BINARY' mode.  This made it hard to send raw data
   to my printer, or to redirect raw data from printer to disk, & vice
   versa.  [...]

I believe this is caused by MS-DOS, not MS C 5.0 --
One of the peculiarities of MeSsy-DOS is that file handles have a primitive
binary/text mode.  The only thing that the binary mode does is when writing
to a device it is impossible to write a ^Z (0x1A, 032) character.  Guess in
which mode the device files (PRN, AUX etc.) are as default ?

You need to do a IOCTL to change the file handle to binary mode and all will
work correctly.  However, I think that a C stdio library should be smart
enough to do this on it's own if the file was opened with O_BINARY (or "wb",
if you are using the buffered I/O functions).
--
   /* * * Otto J. Makela <otto@jyu.fi> * * * * * * * * * * * * * * * * * * */
  /* Phone: +358 41 613 847, BBS: +358 41 211 562 (CCITT, Bell 24/12/300) */
 /* Mail: Kauppakatu 1 B 18, SF-40100 Jyvaskyla, Finland, EUROPE         */
/* * * Computers Rule 01001111 01001011 * * * * * * * * * * * * * * * * */
Technical Details
Message-ID: <OTTO.90Dec14164942@tukki.jyu.fi>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!tukki.jyu.fi!jyu.fi!otto
References: <1990Dec12.141719.15833@mlb.semi.harris.com> <1990Dec13.165542.21022@magnus.ircc.ohio-state.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!tukki.jyu.fi!jyu.fi!otto
From: otto@tukki.jyu.fi (Otto J. Makela)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Microsoft C ver 5.0 ???
Message-ID: <OTTO.90Dec14164942@tukki.jyu.fi>
Date: 14 Dec 90 15:49:42 GMT
References: <1990Dec12.141719.15833@mlb.semi.harris.com>
 <1990Dec13.165542.21022@magnus.ircc.ohio-state.edu>
Sender: news@tukki.jyu.fi (News articles)
Organization: Turing Police, Criminal AI section
Lines: 22
In-Reply-To: sbbrown@magnus.ircc.ohio-state.edu's message of 13 Dec 90 16:55:42 GMT