Fwd: Re: cp command - problem with sparse

Eric Blake ebb9@byu.net
Tue Feb 1 13:52:00 GMT 2005

Hash: SHA1

This question came up on the coreutils list:

Does cygwin provide any support for sparse files on NTFS volumes that
support it?  lseek() could be patched to use FSCTL_SET_ZERO_DATA when a
seek jumps past the end of a file open for writing, but there is still the
issue of when that file is given the FSCTL_SET_SPARSE attribute.

- -------- Original Message --------
Subject: Re: cp command - problem with sparse
Date: Tue, 01 Feb 2005 10:17:01 +0000
From: jay AT excession DOT spiral-arm DOT org (James Youngman)
To: RE <eicher_und_bergmann AT yahoo DOT de>
CC: bug-coreutils AT gnu DOT org
References: <EGECIPGBMFENJDOHIEMIAEMGCBAA DOT eicher_und_bergmann AT yahoo
DOT de>

On Mon, Jan 31, 2005 at 05:30:22PM +0100, RE wrote:

> "cp --sparse=always c:\test.cfg c:\test2.cfg"
> Everything works fine with that cp command, except the 
> fact that I do not get a sparse file.  Even when I copy 
> a sparse file, the sparse attribute is no longer 
> present in the copy an the occupied space on my HD is 
> the same as with the original file.
> What am I doing wrong?
> I tried already different PCs with NTFS (OS = Win2k 
> SP4)

Unix systems automatically generate sparse files when programs seek
forwards on their output file.  There is no need to have a "sparse"
attribute.  This is what coreutils' "cp" does.

Windows and NTFS don't work in this way.  Under NTFS, there is, as you
say, a "sparse" attribute which must be set.  GNU coreutils runs on
Windows under Cygwin and am not sure if Cygwin exposes any form of API
which might allow cp to set the sparse attribute.  It's certainly a lot
more complex to do this under Windows.


Bug-coreutils mailing list

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


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/

More information about the Cygwin mailing list