المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : CStdioFile file size limit



C++ Programming
08-19-2009, 01:50 AM
Hi there
I have just discovered that CStdioFile does not "work correctly" with files bigger than 2^32 bytes. Everything works fine in my program using CStdioFile, until the file size gets up to the limit. (Opening the large file with CFile and doing GetLength() gives the correct value, doing the same with CStdioFile gives garbage, and Seeks to the end crash out with a bad seek exception.) The MSDN site where I discovered this limit says "use CFile" instead. However, CFile is unbuffered, and I need to do quite a bit of skipping around with small reads and writes. I was only using CStdioFile because of its buffering - I'm reading/writing binary data.
Short of writing my own buffer, any ideas? Is there likely to be a big performance hit if I just use CFile instead? Would you advise using CArchive (which I believe is buffered), or is the overhead not worth it?
Thanks for any ideas.
Bill H