处理文件超过2 GB MSVC6更大! [英] Handling Files greater than 2 GB in MSVC6!

查看:250
本文介绍了处理文件超过2 GB MSVC6更大!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

普通文件的相关功能,如fseek的,FTELL等在Windows MSVC6可以处理的文件只有2GB高达(按我目前的理解,请纠正我,如果我错了)。

Normal file related functions like fseek, ftell etc in Windows MSVC6 can handle files only upto 2GB (As per my current understanding, Please correct me if I am wrong).

我想处理文件> 2GB。我应该怎么做呢?什么是可用的功能?

I want to work with files >2GB. How should I go about it? What are the functions available?

推荐答案

我不知道,但这个限制是4 GB,操作系统API和使用API​​的论文的标准库和使用的文件系统。

I am not sure but the limit is 4 GB, OS API and the standard libraries using theses API and the filesystem used.

FTELL fseek的函数使用的是32位整数,所以你将不能够处理更大的文件大于4GB。你将不得不直接使用OS的API。

The ftell, fseek functions are using 32 bit integers so you won't be able to handle file bigger than 4GB. You would have to use the OS API directly.

所以,你必须要小心,你用什么功能,例如用于获取文件的大小,你必须使用EX功能的 GetFileSizeEx ,所以你必须确保你使用使用64位的文件偏移功能。同为 SetFilePointerEx

So you have to be careful what function you use, for example for getting the file size you have to use the ex function GetFileSizeEx, so you have to make sure you use function that use 64 bit file offset. Same for SetFilePointerEx

最后一个字,你必须要知道,有些文件系统限制文件的最大尺寸,在FAT32不会处理设计文件大于4 GB,NTFS会处理任何大小,但API通常为4 GB或更少的大文件进行。

Last word you have be aware that some filesystem limit the maximum filesize, the FAT32 won't handle file bigger than 4 GB by design, NTFS would handle any size but the API generally is made for 4 GB or less big file.

这篇关于处理文件超过2 GB MSVC6更大!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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