There was an error transferring messages: PDMutableFile
stringWithRange:: range position (1808158) lies beyond
end of file (2952)
When transferring a set of messages from one mailbox to
another, the operation often fails.
The problem appears to be that the ftell() after fseek
(SEEK_END) operation doesn't return the correct size on
Windows. This has only happened after transferring
multiple messages. My guess is that write operations
are somehow confusing the fseek/ftell. I tried putting a
fflush() call in before size computation and got a "bad
descriptor" error. I tried moving the fflush inside the
transfer loop (It's currently after it), but that also didn't
help.
I also tried rewriting the PDFile size method to open
another copy of the file and use it instead, but that
would return sizes slightly smaller than the expected
value (which is what makes me think it's a difference
caused by the newly-appended data).
The difference in amount of data in each case appears
to be about the size of a message.