From: Oscar F. <of...@wa...> - 2003-03-25 04:03:52
|
Igor Gnip <gn...@di...> writes: > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6746 > > apparently bug has been fixed ... but not in mingw (yet) > > need help to get around this one... As your test case outputs the same on g++ 3.2.2, Borland 5.5.1 and on Intel v7, I suspect the problem is elsewhere. The docs for readsome says that it depends of the result of rdbuf()->in_avail(). Well, this means that you can't read so many characters as you want on just one chunk. The maximun value for in_avail() is the *buffer* size, which seems 512 bytes by default. in_avail() returns the available characters on the buffer. Next problem is getting the buffer filled before calling readsome. Sure there is a method somewhere. For your test case, putting fs.get(); just before the readsome fills the buffer and then readsome reads the other 511 characters. IMHO, using the C++ IOstreams for reading so much binary info is a mistake, both on terms of complexity and performance. Better stick to the C library or the WinAPI. HTH. -- Oscar |