Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!beta!hc!ames!amdahl!drivax!socha From: socha@drivax.UUCP (Henri J. Socha (7-x6628)) Newsgroups: comp.sys.mac Subject: Re: LSC 2.11 stdio bug Message-ID: <2580@drivax.UUCP> Date: Tue, 13-Oct-87 16:08:02 EDT Article-I.D.: drivax.2580 Posted: Tue Oct 13 16:08:02 1987 Date-Received: Sat, 17-Oct-87 19:33:35 EDT References: <17539@yale-celray.yale.UUCP> Reply-To: socha@drivax.UUCP (Henri J. Socha (7-x6628)) Organization: Digital Research, Monterey, CA Lines: 26 In article <17539@yale-celray.yale.UUCP> robertj@yale.UUCP writes: >I recently got bitten badly by a bug in LSC 2.11's stdio >routines (at least I think that's where the bug is). I was >trying to use the unix emulation routines that simulate >redirection of output. The problem I discovered is that >when I try to send a character code 13 (octal 15) to a file, >when I next read the file, the character code has changed to 10 >(12 octal). I got it too for the longest time but know the fix! In my case it was a demo programme that generate test patterns wrote them to a file and read the result and kept getting the same error, got a 10 (on re-read) expected 13. In the fopen (or whatever, I don't have LSC or my code here). there are options available defining the TYPE of file being opened. One of the type flags (letters?) specifies a BINARY file. I forget the LSC term but its bin called: O_BINARY, O_RAW, or something like that. Anyway, if you specify that flag, the test inside stdio.??? is not made. So, in your open, specify the flag and the problems go away. -- UUCP:...!amdahl!drivax!socha WAT Iron'75 "Everything should be made as simple as possible but not simpler." A. Einstein