Create new files as sparse on NT systems. (2nd try)

Gary R Van Sickle
Tue Feb 18 22:59:00 GMT 2003


> >What kind of program would actually benefit from sparse
> files? And shouldn't
> >it be the responsibility of that program to request them?
> IIRC, linux creates sparse files automatically when you do an lseek to
> a position beyond EOF.  I believe that Windows is similar.

No, Windows does nothing like that.  On Windows, sparse files are completely

"Note: It is up to the application to maintain sparseness by writing zeros
with FSCTL_SET_ZERO_DATA", sez the Platform docs.

Even if you do WriteFile()s with all zeros on a sparse file, you are
actually hitting the disk.

> I would like to see a benchmark but I doubt there will be any
> noticeable
> difference.

The only thing this patch will do AFAICS is set a bit somewhere in the guts
of NTFS that will be pretty much ignored.  I'm with Max, I don't see the
benefit and can only imagine the consequences.

Gary R. Van Sickle
Braemar Inc.
11481 Rupp Dr.
Burnsville, MN 55337

More information about the Cygwin-patches mailing list