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

Vaclav Haisman V.Haisman@sh.cvut.cz
Wed Feb 19 00:21:00 GMT 2003


On Tue, 18 Feb 2003, Gary R Van Sickle wrote:

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

In this respect Windows are ahead of any recent Unix system. I wasn't able find
any Unix/Posix syscall that would allow this unlike Windows.

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

Have you ever tryed the same thing in Unix environment? Writing buffer full of
zeros with write syscall won't gain you anything either. All the zeros will be
physicaly written onto the disk. This means it has the same behaviour as Unix
systems.

> 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.

I don't see any negative consequences of this patch. The only one I can imagine
it can slow down file operations but I very very doubt it.

Vaclav Haisman



More information about the Cygwin-patches mailing list