From: Jack Klein Newsgroups: comp.os.msdos.djgpp Subject: Re: read() also broken Message-ID: References: X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 23 Date: Wed, 11 Jul 2001 23:50:03 GMT NNTP-Posting-Host: 12.84.2.210 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc06-news.ops.worldnet.att.net 994895403 12.84.2.210 (Wed, 11 Jul 2001 23:50:03 GMT) NNTP-Posting-Date: Wed, 11 Jul 2001 23:50:03 GMT Organization: AT&T Worldnet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Wed, 11 Jul 2001 16:53:25 -0500 (CDT), Jeff Bastian wrote in comp.os.msdos.djgpp: > > I just modified my code to use read() instead of fread() as a work-around, > but read() demonstrates the same problem of skipping over the 0x0d > character. Change your program back to using fread(), which is standard, portable, and guaranteed to be available on every C and C++ compiler in the known and unknown world. Then open files for binary input/output in binary mode, that is "rb" instead of "r" and "wb" instead of "w", for the mode argument to fopen(). -- Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html comp.lang.c++ http://www.parashift.com/c++-faq-lite/ alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq