如何在 Windows 中完全读取大于 4GB 的文件? [英] How to completely read a file bigger than 4GB in Windows?

查看:38
本文介绍了如何在 Windows 中完全读取大于 4GB 的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 Windows 中处理许多大于 4GB 的文件.我使用FILE和fread()读取一个文件(大约40GB),并在VS2010 Debug-x64中编译我的代码,但无法完全读取文件.

I need to process many files bigger than 4GB in Windows. I use FILE and fread() to read one file (about 40GB), and compile my code in VS2010, Debug-x64, but the file cannot be read completely.

我在 C++ lib 的源文件中发现,FILE struct 中的成员是 32bit (int),所以我找到了它失败的原因,但是我应该怎么做才能使文件被完全读取?

As I've found in C++ lib's source file, the members in FILE struct are in 32bit (int), so I found why it failed, but what should I do to make the file be read completely?

推荐答案

如果您只关心在 Windows 上运行,您可以使用 CFile 对象.它的成员是 64 位的.

If you only are concerned about running on Windows, you can use a CFile object. Its members are 64-bit.

这篇关于如何在 Windows 中完全读取大于 4GB 的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆