delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/08/23/11:19:14

Date: 23 Aug 93 16:29:00 MET
From: "ERIC HILDEBRANDT" <HILDEBRANDT AT physik DOT uni-frankfurt DOT de>
Subject: problems with binary random file access using ifstreams
To: "djgpp" <djgpp AT sun DOT soe DOT clarkson DOT edu>

		hello everybody,

	I have got another problem, this time it is with binary random
	file access in Cplusplus.
	
	Writing a program that needs to read binary data (chinese character
	bitmaps) out of a (font) file , and using the libgpl ifstream
	functions, I always  get mixed up data in the beginning
	an none at all after the first 300 bitmaps.

	I used both versions of the libraries, the libgpl23
	(or so, the one out of the /pub )
	and the one in dj*.* files.
 
	The funny thing is, that when I am using the C stdio functions
	fopen, fseek and fread everything works fine.
	It is just when I use the ifstream.read() that I get problems.
	ifstream.seekg() seems to work, it might be
	the extraction with read() or get() that causes the trouble.
 	
        I tried to solve the problem by using the SFile class
	but this did not help either.
        This all happened when I used the libgpl23, it did change a
	bit when I used the dj-library, now everything worked as long
	as I started at the beginning of the file, but when I started
	somewhere in the middle I had the same problems as before.
	
	Well, I have the impression, that it might have to do with
	the binary access, but I *did* set ios::bin (resp. ios::binary).
	Finally I gave up and used the C-functions, but I'd rather
	like to use the ifstream funktions, so here is my question:

Did anybody have similar problems with cplusplus binary random access?
	(or is it just some weird bug in my programm :-( )



		Thanks for any suggestions,


					Eric



e-mail: hildebrandt AT pi1 DOT physik DOT uni-frankfurt DOT de

snail mail: Eric Hildebrandt
	    Weilstr.8                
            65183 Wiesbaden
            Germany

 






	
	
	
		


- Raw text -


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