每个目录的限制的文件数FAT32 [英] FAT32 number of files per directory limit

查看:427
本文介绍了每个目录的限制的文件数FAT32的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我试图code一个FAT系统在C Xillinx的Kintex 7卡上。它配备了一个MicroBlaze和我已经成功地创建大部分所需的功能。

I'm currently trying to code a FAT system in C on a Xillinx Kintex 7 card. It is equipped with a MicroBlaze and I've already managed to create most of the required functions.

我现在面临的问题是关于文件夹的总容量,我读过在网络上,在FAT32的文件夹应该能包含超过65 000文件,但该系统我已经到位我限制在每个文件夹509文件。我想这是因为FAT32的工作,但来这里的路上我的COM prehension的就是我迄今取得:

The problem I'm facing is about the total capacity of a folder, I've read on the web that in FAT32 a folder should be able to contain more than 65 000 files but with the system I've put in place I'm limited to 509 files per folder. I think it's because of my comprehension of the way FAT32 works but here's what I've made so far:


  • 我已经创建,在MBR(0扇区)写入正确的数据格式功能和卷ID(部门2048我的盘上)。

  • 我创建写入根目录的内容(即在部门124 148开始第一簇)功能

  • 我已经创建了一个写出包含X的文件夹的名称在根目录(部门124148)写入和文件名被写入下一个簇(部门自124212大小的N个文件的新文件夹功能我已经设置簇大小为64个扇区)。最后,文件(一个简单的计数器)的内容写在上界124276开始下一个集群上。

下面,事情是,一个文件夹的大小为1簇的,这意味着它有64个扇区的容量= 32KB和我可以创建一个目录仅512(±2)文件!然后,我的问题是:是否有可能改变一个文件夹的大小簇的簇号?目前,我只用1群集,我不知道如何去改变它。这是否与驱动器的FAT?

Here, the thing is that a folder has a size of 1 cluster which means that it has a capacity of 64 sectors = 32KB and I can create only 512 (minus 2) files in a directory! Then, my question is: is it possible to change the size of a folder in number of cluster? Currently I use only 1 cluster and I don't understand how to change it. Is it related to the FAT of the drive?

在此先感谢您的帮助!

请注意:我的硬盘是由Windows,当我将其插入的认可,我可以访问和读取所有文件(除了那些超过​​510极限),我可以通过Windows资源管理器创建新文件。显然,它来自我的理解文件创建​​和创建文件夹的方式!

NOTE: My drive is recognized by Windows when I plug it in, I can access and read every file (except those that exceed the 510 limit) and I can create new files through the Windows Explorer. It obviously comes from the way I understand file creation and folder creation!

推荐答案

在FAT文件系统的目录只是一种特殊类型的文件。因此,使用多个簇此文件,就像你会与任何其他文件。

A directory in the FAT filesystem is only a special type of file. So use more clusters for this "file" just as you would with any other file.

的簇号的根目录下保存的在FAT32头偏移的 0x2c 并通常聚集的 2 的。在集群地图集群2项包含值 0x0FFFFFFF (结束簇),如果这是根目录下的唯一集群。您可以使用两个集群(如集​​群2和3)的根目录下,如果你设置3组在集群地图为集群2台(套 0x00000003 作为下一个簇集群2的集群地图的入账价值)。现在,第三组可以是最后一个群集(通过其入口设置为 0x0FFFFFFF )或可以依次指向另一个集群,使为根目录更大的空间

The cluster number of the root directory is stored at offset 0x2c of the FAT32 header and is usually cluster 2. The entry in the cluster map for cluster 2 contains the value 0x0FFFFFFF (end-of-clusters) if this is the only cluster for the root directory. You can use two clusters (for example cluster 2 and 3) for the root directory if you set cluster 3 in the cluster map as the next cluster for cluster 2 (set 0x00000003 as value for the entry of cluster 2 in the cluster map). Now, cluster 3 can either be the last cluster (by setting its entry to 0x0FFFFFFF) or can point in turn to another cluster, to make the space for the root directory even bigger.

簇不需要是后续的,但它通常具有上依次读取性能增益(这就是为什么整理卷可以大量迁入提高性能)。

The clusters do not need to be subsequent, but it usually has a performance gain on sequential reading (that's why defragmenting a volume can largly increase performance).

这篇关于每个目录的限制的文件数FAT32的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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