This is the mail archive of the cygwin@cygwin.com 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
that
> or provide references to the parts of the documentation that says that
normal
> 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
sparse
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
disk
again, the new block can not be written in consecutive order.  It is either
written
after the last block of the file, or somewhere else on disk.

Before:
   ... [BLOCK 1][BLOCK 3] ...

After:
   ... [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.


                                                  Bill




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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