Path: utzoo!yunexus!maccs!gordan From: gordan@maccs.UUCP (gordan) Newsgroups: comp.lang.c Subject: Re: MSC 5.0 Bug??? Message-ID: <983@maccs.UUCP> Date: 8 Feb 88 10:32:43 GMT Article-I.D.: maccs.983 Posted: Mon Feb 8 05:32:43 1988 References: <11677@brl-adm.ARPA> Reply-To: gordan@maccs.UUCP () Organization: Amateur Brain Surgeons of America Lines: 21 In article <11677@brl-adm.ARPA> C03601DM%WUVMD.BITNET@CUNYVM.CUNY.EDU (Derek Morgan) writes: -Is anybody aware of a bug in the fwrite() routine of MSC 5? If not, then -either I found one (highly unlikely), or my program is screwed up in some -subtle way (Extremely probable)... Perhaps your problem has something to do with the fact that newline is two characters (CR LF) in MS-DOS, while C prefers it to be a single character ('\n'). I think operating systems like MS-DOS use low-level routines to automatically map between CR LF <--> '\n' if you open a file as a text file. However this can have counterintuitive results, e.g. if you do ftell (...) fread (N bytes) ftell (...) your position in the file as reported by ftell will not necessarily have been incremented by exactly N, due to the translation of two bytes into one for CR LF. Disclaimer: it's 5:30 am. Any resemblance to fact is purely coincidental.