delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/16/07:25:33

Date: Sun, 16 Jan 2000 10:29:56 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Aaron Chernosky <chernobl AT wt DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Binary Files
In-Reply-To: <38808ACC.6C76D41C@wt.net>
Message-ID: <Pine.SUN.3.91.1000116102935.11666P-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 15 Jan 2000, Aaron Chernosky wrote:

> Does the function getc(FILE *f) work with binary files, mainly in that
> it doesn't screw up the data when u read it in?

It does, if you open the stream f in binary mode (or switch it to
binary mode using `setmode').

If the stream f is connected to the console, and you want
single-character input, you need to use termios functions (tcsetattr
etc.) to set the terminal for such read mode.  See the docs of
tcsetattr and the section called "Termios function" in libc.info for
more details.

- Raw text -


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