delorie.com/archives/browse.cgi | search |
Date: | Tue, 7 Jan 2003 08:37:14 +0200 (IST) |
From: | Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> |
X-Sender: | eliz AT is |
To: | Dmitry Rutsky <deemus AT rambler DOT ru> |
cc: | djgpp AT delorie DOT com |
Subject: | Re: File reading problem |
In-Reply-To: | <200301070413.12292.deemus@rambler.ru> |
Message-ID: | <Pine.SUN.3.91.1030107083546.7414I-100000@is> |
MIME-Version: | 1.0 |
Reply-To: | djgpp AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | djgpp AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
On Tue, 7 Jan 2003, Dmitry Rutsky wrote: > Why doesn't the included program work correctly? Because you open the file in the (default) text mode. Text-mode reads strip the CR characters from each CR-LF pair, so you get smaller size. Open the file in binary mode (use "rb" in the `fopen' call), and the problem will go away.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |