Changes between Version 1 and Version 2 of Ticket #77, comment 3
- Timestamp:
- Oct 2, 2018, 2:57:34 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #77, comment 3
v1 v2 1 1 Heh, just noticed: on exFAT, "." and ".." are missing in non-root directories too. So, I need to fix that too. (exFAT does not have neither "." nor ".." in its directories). 2 2 3 > The normal value for "RootDirStrtClus?" is always "2" and seems to indicate that it relates to a partition start so how could that ever fail to match for any FAT partition ? 4 3 5 DirCluster is a start cluster of a directory. RootDirStrtClus is a DirCluster of a root directory. Yes, on FAT32, it is usually 2, which means that it usually follows FAT (the very first cluster). Cluster numbers 0 and 1 are reserved. On FAT12/FAT16, root directory starts right after last FAT, too. But here, root dir belongs to a reserved area, which has not assigned any cluster number. Cluster 2 immediately follows the root directory. In fat32.ifs, each directory is specified by its DirCluster. So, to accomodate FAT root dir case, I assigned it a special "fake" value 1. So, directory is FAT root directory if and only if its DirCluster == 1. So, each directory has its dir cluster, including FAT root dir. 6 7 It can fail to match if the directory is not a root one. So, I add "." and ".." to root dirs only. They have ulDirCluster == pVolInfo->BootSect.bpb.RootDirStrtClus. pVolInfo->BootSect.bpb.RootDirStrtClus == 2 on FAT12/FAT16, on FAT32 it is usually 2. And on exFAT, it is usually 5 or 6 (they follow an Allocation bitmap and UpCase table, which have lesser cluster values). 4 8 5 9 And yes, clusters always relate to a partition, not a whole disk. Whole disk has sectors, only. Cluster is a FAT concept. HPFS has no clusters, for example. It has sectors. And JFS is divided to blocks of 4 KB, which aren't called clusters. So, the notion of cluster is not defined outside FAT and only FAT partitions are divided to clusters.