www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/05/21:43:35

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: help: read()ing from files containing 0x1A
Date: Sat, 03 May 1997 13:33:47 -0700
Organization: Alcyone Systems
Lines: 19
Message-ID: <336BA12B.6C9AABFC@alcyone.com>
References: <E9KKxq DOT E3L AT wlbr DOT iipo DOT gtegsc DOT com>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ethan Rohrer wrote:

> 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...

Easy.  Open the file in binary mode.

-- 
       Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
                     Alcyone Systems /   web / http://www.alcyone.com/max/
San Jose, California, United States /  icbm / 37 20 07 N  121 53 38 W
                                   \
                      "The future / is right there."
                                 / Bill Moyers

- Raw text -


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