i've read this : http://www.maverick-os.dk/FileSystemFormats/FAT32_FileSystem.html

and get this :


Each of these entries are 32 bytes long. The root directory can contain the number of entries as defined in the Boot Parameter Block in the boot sector. When creating a sub directory, one cluster will be assigned to it. This sub directory can then be filled with entries, until the cluster is full. If filled beyond the limit then another cluster will be allocated . The number of directory entries which can fit in each cluster, depends on the size of the cluster itself. Hence more space equals more 32 byte entries. This is the format of the directory entries:


i don't know which cluster will be allocated ? is the next cluster of cluster was assigned for this directory ?  so what if "the next cluster" is in used ?
thanks for read this.
Posted on 2006-09-21 22:15:17 by secmask
I would assume that a scan is done for "next free cluster"... been a while since I read about the FATx filesystem though. Some good links for topics like this:

http://www.osdev.org/
http://www.osdever.net/
http://www.nondot.org/sabre/os/articles
Posted on 2006-09-22 02:25:03 by f0dder

I would assume that a scan is done for "next free cluster"...


Absolutely right.  If you wanted to get into avoidance of fragmentation, it can get more complex, but the easiest to do with decent effectiveness is just check if the cluster right after the last cluster of the directory is free, and if so, take it, else search elsewhere on the drive for a free cluster.

In NTFS it's a lot faster to search, but a lot harder to do everything, just because it's not well-specified.

Best of luck  :)
Posted on 2006-09-22 11:18:59 by hackulous

In NTFS it's a lot faster to search, but a lot harder to do everything, just because it's not well-specified.


I would think that NTFS is well specified, but that the specification is only available to a select few ;)
Posted on 2006-09-22 11:22:52 by f0dder