From: "A. Sinan Unur" 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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. *******************************************************************