delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/12/01:10:38

Xref: news-dnh.mv.net comp.os.msdos.djgpp:1486
Path: news-dnh.mv.net!mv!news.sprintlink.net!cs.utexas.edu!swrinde!tank.news.pipex.net!pipex!news.mathworks.com!satisfied.apocalypse.org!news2.near.net!ctp!pdrap
From: pdrap AT ctp DOT com (Patrick Draper)
Newsgroups: comp.os.msdos.djgpp
Subject: Reading a file with read()
Date: 11 Aug 1995 15:11:43 GMT
Organization: Cambridge Technology Partners
Lines: 15
Nntp-Posting-Host: yoda.ctp.com
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

I've got a program that does a read() call to read a block from
a file. The program works perfectly under UNIX and Linux, but when
I compile it on djgpp, it gets hung up on a 0A (line feed) character
and doesn't read it. As a result, when I tell it to read 16 bytes
where there's a 0A in the block, only 15 are read.

What do I need to do to open the file in a true binary mode, with
no CR/LF translation going on?


 /\/\ |Patrick Draper                        Mr. Order, he runs at a|
/ /_.\|Cambridge Technology Partners, Inc.      good pace, but old  |
\  /./|e-mail: pdrap AT ctp DOT com                      Mother chaos is   |
 \/\/ |Amsterdam, The Netherlands                 winning the race. |

- Raw text -


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