FAT32: Attributes of the Root Directory

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
mark3094
Member
Member
Posts: 164
Joined: Mon Feb 14, 2011 10:32 pm
Location: Australia
Contact:

FAT32: Attributes of the Root Directory

Post by mark3094 »

Hi,

I'm working with FAT32, and I can see that it's simple to get attributes for most files; Just load the file's parent directory, and look at the corresponding directory entry.
Is there a way to get attributes, such as creation time, modified time, etc for the root directory? As it does not have a parent directory, I'm not sure how to get these details beyond what is in the BPB, which doesn't have time stamps.
I've had a look through Microsoft's FAT32 File System Specification, but can't find anything there.

Could I safely assume that any time stamps could be zero? Is there any way of determining the size of the root directory, other than following the cluster-chain, and counting the clusters?


Thanks
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: FAT32: Attributes of the Root Directory

Post by alexfru »

From the official documentation:
For FAT32, the root directory can be of variable size and is a cluster chain, just like any other directory is. The first cluster of the root directory on a FAT32 volume is stored in BPB_RootClus. Unlike other directories, the root directory itself on any FAT type does not have any date or time stamps, does not have a file name (other than the implied file name “\”), and does not contain “.” and “..” files as the first two directory entries in the directory.
So, no date/time, no attributes, no size.
User avatar
mark3094
Member
Member
Posts: 164
Joined: Mon Feb 14, 2011 10:32 pm
Location: Australia
Contact:

Re: FAT32: Attributes of the Root Directory

Post by mark3094 »

I missed that line in the official docs.
Thanks for your response, I appreciate it.
Post Reply