This is the mail archive of the cygwin 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]

Fwd: Re: cp command - problem with sparse


-----BEGIN PGP SIGNED MESSAGE-----
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.


See
http://www.ntfs.com/ntfs-sparse.htm
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/fsctl_set_zero_data.asp


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


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

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
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

iD8DBQFB/4jI84KuGfSFAYARArbqAKC8oMiDsvW93G9xZpZtjcIcFxPeRACeNti6
iWWYrjHN7i1YlvfKMNLqps8=
=CLd3
-----END PGP SIGNATURE-----

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