-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


The Tuesday 2008-01-22 at 19:33 -0500, James Knott wrote:

But that is not a characteristic of the FAT format, but of how the
operating system uses it. It is perfectly possible to seek a large
enough free area in the disk, then save the file there. It is the
operating system who saves time by saving in the first space it finds,
instead of searching harder for the best fit. It is not the definition
of the format that is at fault, is the implementation.


Then, if later, a file grows, and there is no free space at the end,
it has to be fragmented - same in fat as in any other system. I think
that in ext2 the system tries to leave space at the end for that
chance, which is, I think, one of the reasons why performance
decreases if the disk is full. I think that in ext2 the file can be
moved elsewhere, but I'm not sure. In msdos this was not possible
because the OS was not the only one capable of accessing the filesystem.

I once thought of writing a program that would defrag a fat drive in
the background, without stopping jobs... just an idea, I never started
writing, though.


Well, going back to basics, a file system is just a method of allocating
a pile of sectors in some manner.  FAT does this in a very basic manner,
just starting at the beginning of the disk looking for free space and
working it's way across the disk.  If you want to do something
different, you create a new file systems, such as ext2 or HPFS, which
has the mechanisms for more efficient allocation of the sectors or
better performance etc.  However, since it's now different from the
"original" FAT, it's a new file system.


You are confusing the filesystem structure with the method used to use it. You can have an operating system allocating files in contiguous sectors on a fat filesystem, and it will still be fat. That doesn't change.


File systems such as HPFS or
ext2 maintain a bit map of free space, which enables them to quickly
find a free block just large enough to hold the file.

So does vfat. The FAT table is just that; well, rather a "byte" map, with another function added.

They also use a
B-tree for quick searching.  Ever notice how Linux by default sorts by
name and Windows doesn't?  You can thank the file system for that.  As
for the OS managing the sectors etc., it always does, by using FAT file
system code or NTFS file system code or ext2 etc.  But that does not
change the way the various file systems were designed to work.  If you
create a different way, you create a different file system.

No, not really. The structure is one thing, the method is another - more so with fat, because you could write to it bypassing the operating system completely.


Also, you generally don't "grow" a file.  For safety reasons, you copy &
modify, leaving the original on the disk, until the operation is
completed and the now dead file is marked as free space.

I know for certain that in dos/vfat you can grow a file: they call it "append mode". And I'll make an educated guess that linux does the same, for instance with log files. Which is different operation than when editing a text file, where the usual is doing what you describe.

- -- Cheers,
       Carlos E. R.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)

iD8DBQFHlprJtTMYHG2NR9URAvlNAJ9J7eXKc21W7z9eyqvndKwQKxTcjgCdFOeQ
Kupz/90xqCdY/qabzuZ0sUk=
=tVMh
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to