delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/18/11:56:27

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: files and Djgpp
Date: Tue, 17 Jun 1997 20:46:11 -0400
Organization: Cornell University http://www.cornell.edu
Lines: 25
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <33A72FD3.5F6A@cornell.edu>
References: <33a4bf36 DOT 4789992 AT news DOT redestb DOT es>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: cu-dialup-0029.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Javier Loureiro Varela wrote:
> 
>         Why this call doesn't read all file?
>         fread(buffer, sizeof(unsigned char), 64000, file);

are you sure the file is smaller than 64,000 bytes?
> 
>         I open my file using:
>         file = fopen(argv[1], "r");

is the file binary or text? if it is binary and the default mode is set
to text, then any ctrl-z in the file will be interpreted as EOF, and
you'll only be able to read up to that point. so, open the file in
binary mode.
-- 
   Sinan
 
*******************************************************************
 A. Sinan Unur                                WWWWWW
                                              |--O+O
 mailto:sinan DOT unur AT cornell DOT edu                C   ^ 
 http://www.people.cornell.edu/pages/asu1/     \  ~/ 

Unsolicited e-mail is _not_ welcome, and will be billed for.
*******************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019