delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/11/10/02:33:15

From: swarnerx3 AT acadia DOT net (Scott Warner)
Subject: Debugging
10 Nov 1997 02:33:15 -0800 :
Message-ID: <199711101016.FAA06387.cygnus.gnu-win32@p2.acadia.net>
Mime-Version: 1.0
To: <gnu-win32 AT cygnus DOT com>

Thanks for all your help!  I have isolated the problem to a binary file
read error.

	f.open("bindings.dat", ios::in | ios::binary);

	while (!f.eof()) {

		f.read((unsigned char*)(tok), sizeof(int) * 3);

	// code follows here to test data

	};


The data is written to this file in chunks of 3 integers.  Now, the file is
0 bytes because there is no data written.  When I test the file open I find
f.bad() and f.fail() both return nonzero values.  I feel this is probably
something simple, but can anyone tell me what is wrong here?  Will this
error always occur with 0 length files?  The bad() being set sounds...
well, bad.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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