Tim Burgess
2014-07-26 16:20:24 UTC
Hi,
I'm reading a series of records in from a data file using wxFFile. The file
contains 100 records and opens for reading without error, but I only get the
first few records ( 7) before the read operation fails to read the correct
number of bytes:
FileRecords myRecords[ 100];
for (int nRecordNumber = 0; nRecordNumber < 100; nRecordNumber++)
{
size_t nResult = myFile.Read( myRecords[ nRecordNumber],
RECORD_LENGTH);
if (nResult != RECORD_LENGTH)
{
// ... I handle the error here. The record length (EWI_PATCH_LENGTH) is 206
bytes, but I only seem to read 99 for the 8th record
}
I have another version of the application which reads the same files and
successfully brings in all 100 records - this was written using QT and my
application is a WX port of the same code to solve some accessibility
problems. The QT equivalent functions for the open, read and seek operations
are trivial to port, so I'm pretty sure I'm getting that right. The data
file I'm reading is over 22k long and inspecting it in an editor shows more
records beyond the ones I successfully read in. How can I gather more
information to help me figure out why it's failing? Any and all ideas most
welcome.
Best wishes.
Tim Burgess
I'm reading a series of records in from a data file using wxFFile. The file
contains 100 records and opens for reading without error, but I only get the
first few records ( 7) before the read operation fails to read the correct
number of bytes:
FileRecords myRecords[ 100];
for (int nRecordNumber = 0; nRecordNumber < 100; nRecordNumber++)
{
size_t nResult = myFile.Read( myRecords[ nRecordNumber],
RECORD_LENGTH);
if (nResult != RECORD_LENGTH)
{
// ... I handle the error here. The record length (EWI_PATCH_LENGTH) is 206
bytes, but I only seem to read 99 for the 8th record
}
I have another version of the application which reads the same files and
successfully brings in all 100 records - this was written using QT and my
application is a WX port of the same code to solve some accessibility
problems. The QT equivalent functions for the open, read and seek operations
are trivial to port, so I'm pretty sure I'm getting that right. The data
file I'm reading is over 22k long and inspecting it in an editor shows more
records beyond the ones I successfully read in. How can I gather more
information to help me figure out why it's failing? Any and all ideas most
welcome.
Best wishes.
Tim Burgess
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users