This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SPARSE files considered harmful - please revert

> I think you need to read the documentation a little more closely.  Either
> or provide references to the parts of the documentation that says that
> RW operations would fragment a sparse file.

It is rather obvious.  Let say you have three blocks worth of data, and
is written into a file with a physical block followed by a sparse
block followed by a physical block.  No disk space is reserved for the
sparse block.  Why should it be, as it would defeat the whole purpose of
using sparse files?  So physically on disk you have two consecutive physical
blocks.  What then happens if you open the file in RW mode, seek to the
block and write some data?  You now have a file with three physics blocks.
However, unless the operating system is going to rewrite the whole file to
again, the new block can not be written in consecutive order.  It is either
after the last block of the file, or somewhere else on disk.

   ... [BLOCK 1][BLOCK 3] ...

   ... [BLOCK 1][BLOCK 3] ... [BLOCK 2] ...

Of course, if you run the defragmenter regularly, you can fix these
fragmented files.  But if it is a file you regularly modify, it is best not
to make
it a sparse file to begin with.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]