为什么 FAT32 磁盘的文件大小限制为 4GB?

发布于 2024-10-11 15:56:27 字数 316 浏览 2 评论 0原文

我不是在寻找解决方法;我想要一个解释。我通过 Google 找到的大多数链接只是告诉我文件限制为 4GB,但没有告诉我原因。

我知道维基百科的解释: http://en.wikipedia.org/wiki/File_Allocation_Table# FAT32

不过这里还是没有详细讲为什么。 (SCANDISK 与它有什么关系?)

也许那时我就会明白是否有可能克服 4GB 文件大小限制。

I'm not looking for a workaround; I'd like an explanation. Most of the links I found through Google just tell me that the file limit is 4GB, but not why.

I am aware of the explanation by Wikipedia: http://en.wikipedia.org/wiki/File_Allocation_Table#FAT32

But this still does not go into detail about why. (What does SCANDISK have to do with it?)

Maybe then I will understand whether it's possible to overcome the 4GB file size limit.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不羁少年 2024-10-18 15:56:27

因为FAT32存储32位文件大小,32位可以存储的最大文件大小是2^32-1 ~= 4.29e9。 2^32-1 字节 = 4GB - 1 字节。

(事实上​​,维基百科文章对此进行了解释。)

Because FAT32 stores 32-bit file sizes and the maximum you can store in 32 bits is 2^32-1 ~= 4.29e9. 2^32-1 bytes = 4GB - 1 byte.

(This is, in fact, explained in the Wikipedia article.)

甜味拾荒者 2024-10-18 15:56:27

为了扩展这个答案,FAT32 是从 FAT16 和 FAT12 派生出来的。当 FAT12 推出时,PC 运行 16 位操作系统,并且没有大于 10 兆字节的驱动器。我认为没有人会想到 PC 上的任何人都需要一个大小为最大可用驱动器四百倍的文件。此外,即使 Microsoft 有先见之明为每个目录条目分配一个额外的字节来保存文件大小的第 32-39 位(允许每个文件最多 1 TB),任何应用程序程序员都不会使用它。没有语言为大于 32 位的整数数学提供方便的支持;甚至 32 位数学也被认为非常奇特。

我心中的一个更大的问题是,为什么我不知道任何朝着不基于顺序编号扇区的标准非 FAT32 存储接口迈进的努力。闪存驱动器和硬盘驱动器都可以从了解各种扇区写入的逻辑意义中受益(对于闪存驱动器,因为它可以消除在执行磨损管理时复制已删除扇区的需要;对于硬盘驱动器,因为它允许写入以不违反数据一致性要求的方式重新排序)。

To extend that answer, FAT32 is derived from FAT16 and FAT12. When FAT12 was introduced, PCs ran a 16-bit OS, and there were no drives larger than ten megabytes. I don't think anyone was expecting that anyone on a PC would ever need a file that was four hundred times the size of the largest available drive. Further, even if Microsoft had the foresight to allocate an extra byte for each directory entry to hold bits 32-39 of the file size (allowing files up to one terabyte each) it's doubtful any application programmers would have used it. No languages provided convenient support for integer math bigger than 32 bits; even 32-bit maths were considered pretty fancy.

A bigger question in my mind is why I'm unaware of any efforts to move toward a standard non-FAT32 storage interface that isn't based on sequentially-numbered sectors. Both flash drives and hard drives could benefit from knowing the logical significance of various sector writes (in the case of flash, because it would remove the need to copy deleted sectors when performing wear management; in the case of hard drives, because it would allow writes to be resequenced in ways that would not violate data consistency requirements).

缱倦旧时光 2024-10-18 15:56:27

我也有同样的疑问,最后意识到每个文件都有自己的元数据,文件大小包含4个字节。因此,最大文件大小为 4G - 1 字节。

I have the same doubt, and finally realized that every file has its own meta data contains 4 bytes for the file size. So, the max file size is 4G - 1 bytes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文