delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/12/02:00:11

Date: Thu, 12 Sep 1996 08:47:10 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: John Moon <moon2 AT ccfsun DOT nrl DOT navy DOT mil>
Cc: djgpp AT delorie DOT com, moon2 AT ccfsun DOT nrl DOT navy DOT mil
Subject: Re: Binary files and ^C chars-try again
In-Reply-To: <3237032D.258A@ccfsun.nrl.navy.mil>
Message-Id: <Pine.SUN.3.91.960912084500.15096G-100000@is>
Mime-Version: 1.0

On Wed, 11 Sep 1996, John Moon wrote:

> This may be a dumb question, but
> when I try to read a ^C char in binary from a 
> file I get an EOF condition, no matter if I try
> to read further into the file or not. Is this a

Your program doesn't open the file in binary mode, so it stops reading at 
the first ^Z (not ^C) character it sees.  ^Z is a kind of software EOF in 
DOS, and DJGPP behaves this way also to be compatible.  Change your 
program to say `fopen(file, "rb")' and `fopen(file, "wb")', and you 
should be OK.

- Raw text -


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