fwrite() misses writing a byte



I have an application which writes huge number of bytes into the
binary files which is just some marshalled data.

int len = Data.size(); //arrary size
for (int i = 0; i < len; ++i)
fwrite(&Data[i], 1, 1, f);

now after running this for long time and pushing millions of bytes, It
once misses writing the last byte of fData. Then the further push of
bytes is again correct. As i am not using the return value for the
fwrite I think there is some error which could be due to buffer
overrun in the stream. This is hard to reproduce and happening on the
Solaris.
Any help will be appreciated.

.



Relevant Pages

  • Re: add dlls + ocxs to source safe ?
    ... Ralph wrote: ... as you likely know binary files are not stored as incremental ... compared to the potential cost ... of not being able to reproduce a customer's problem. ...
    (microsoft.public.vb.general.discussion)
  • Re: fwrite() misses writing a byte
    ... Richard Heathfield writes: ... binary files which is just some marshalled data. ... Either he's using operator overloading (most ...
    (comp.lang.c)