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

Corinna Vinschen cygwin-patches@cygwin.com
Wed Feb 19 20:19:00 GMT 2003


On Wed, Feb 19, 2003 at 08:41:35PM +0100, Corinna Vinschen wrote:
> On Wed, Feb 19, 2003 at 12:57:38PM -0500, Christopher Faylor wrote:
> > On Wed, Feb 19, 2003 at 10:39:17AM -0500, Joe Buehler wrote:
> > >One thing to investigate would be what happens when Windows trys to mmap()
> > >a sparse file.  It doesn't bother a UNIX box, but Windows?  Perhaps that
> > >is what BitTorrent is presently doing?
> > 
> > Hmm.  Good point.  Does some brave soul want to apply the patch and do some
> > experimenting?
> 
> I'm going to test that *shiver*.

Well... as a first result:  I tried to write two 4K blocks with a
lseek(16K), creating a 24K file which should use only 8K on disk.

It didn't work.

Unfortunaltely, NTFS5 seem to support sparseness only if the files
are big enough or if the sparse blocks are big enough.  The above
test worked for me beginning with an lseek of 129K.

> Just a hint:  Since we're calling GetVolumeInformation in path.cc
> [bla bla bla]

Apparently I didn't look into the patch. :-P

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.



More information about the Cygwin-patches mailing list