Date: Tue, 7 Jan 2003 08:37:14 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Dmitry Rutsky cc: djgpp AT delorie DOT com Subject: Re: File reading problem In-Reply-To: <200301070413.12292.deemus@rambler.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.