Mail Archives: djgpp/1996/04/28/18:38:55
| Xref:  | news2.mv.net comp.os.msdos.djgpp:3220
 | 
| From:  | nate AT millcomm DOT com (Nate Erkkilla)
 | 
| Newsgroups:  | comp.os.msdos.djgpp
 | 
| Subject:  | C++ ios::binary file problems
 | 
| Date:  | 28 Apr 1996 08:11:36 GMT
 | 
| Organization:  | perg
 | 
| Lines:  | 20
 | 
| Message-ID:  | <4lv97o$15q@news.ycc.yale.edu>
 | 
| NNTP-Posting-Host:  | remote4-line28.cis.yale.edu
 | 
| Mime-Version:  | 1.0
 | 
| To:  | djgpp AT delorie DOT com
 | 
| DJ-Gateway:  | from newsgroup comp.os.msdos.djgpp
 | 
question for anyone using gxx for reading and writing binary files:
I'm using DJGPP version 2.0 with cwsdpmi v.90+, coding in c++ and
compiling with gxx, and I am running into difficulties updating existing
binary files (created in MSDOS, with the same compiler, on the same computer, 
etc).  Reading in binary information via <ifstream>.read works
without any problems (i've been using it for weeks).  <ifstream>.seekg 
followed by a read also works without any glitches.  However <ofstream>.write 
only wants to work if the file is new, or if the ofstream object is opened 
with (ios::binary | ios:app) (append) flags.  If I attempt to <ofstream>.seekp 
a random location in the file and <ofstream>.write, the program freezes and 
locks up the machine.  I've read all the information  in the DJGPP info 
directory, and scowered the net for some assistance with ths problem and I 
cannot determine why I am having these difficulties modifying random locations 
of binary files. If anyone has any ideas, or knows about a problem/bug, etc, 
please drop me some mail, as I don't make it to usenet on a regular basis.  
Thanks,
-Nate Erkkilla <nate AT millcomm DOT com>
- Raw text -