Quote:Original post by JohnBolton
Perhaps the write function, seeing that the address of the data you want written is 0, chooses to do nothing instead of crashing.
Bingo, JohnBolton is 100% correct. BKT, this line:
p->pHandle->write(0, sizeof(byte_t)*ARCHIVE_FILE_OFFSET );
Writes 'nothing' to the file. What you need to do is something like this:
char buffer[16];memset(buffer,0,16);snprintf(buffer,16,"%i",sizeof(byte_t)*ARCHIVE_FILE_OFFSET);p->pHandle->write(buffer, sizeof(byte_t)*ARCHIVE_FILE_OFFSET );
The concept is to convert the int that is the file header offset into a string first, then write it out. You may have to recast a few things, but that should do the trick. It is definitly legal, you are writing out 'nothing' to a file, so that's why it does not crash. If you switched to release mode, I could not be so sure of the results.
- Drew