delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/03/05:33:24

Newsgroups: comp.os.msdos.djgpp
From: rer AT wlv DOT iipo DOT gtegsc DOT com (Ethan Rohrer)
Subject: help: read()ing from files containing 0x1A
Sender: news AT wlbr DOT iipo DOT gtegsc DOT com (Steven M. Schultz)
Organization: GTE Government Systems, Thousand Oaks CA USA
Message-ID: <E9KKxq.E3L@wlbr.iipo.gtegsc.com>
Date: Fri, 2 May 1997 20:01:02 GMT
Lines: 22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello all,

I am trying to port some code from my UNIX account to my DOS machine.
My program reads a binary file using a open()/read()/close() sequence.
It worked like a champ in my UNIX account.

Now, under DJGPP, I find that read() stops reading when it encounters
the EOF character (0x1A), which just happens to occur every here and
there in my binary files...

So I've got three questions:
    (1) why doesn't this work under DJGPP?
    (2) why does this work under UNIX?
and most importantly...
    (3) how do I make it do what I want?
	(read the entire file, regardless of those 0x1A characters)

I'd appreciate any pointers (except NULL),
thanks
Ethan
rer AT wlv DOT iipo DOT gtegsc DOT com

- Raw text -


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