tar --atime-preserve with an empty file triggers a warning

Eric Blake eblake@redhat.com
Mon Mar 7 14:38:00 GMT 2011


On 03/07/2011 07:20 AM, EXCOFFIER Denis wrote:
> Hello,
> 
> I've the experienced the following (100% reproducible under 1.7.7-1 or
> 1.7.8-1):
> 
> % cp /dev/null empty

Why not the much simpler:

: > empty

> % tar cf empty.tar --atime-preserve empty
> /usr/bin/tar: empty: Cannot utime: Invalid argument
> /usr/bin/tar: Exiting with failure status due to previous errors
> %
> 
> Of course the empty.tar is created as expected (ie identical as without
> `--atime-preserve). The warning is not produced on Solaris, Darwin or
> Linux,
> therefore i contacted this list. Do you think, with your expertise, that i
> should contact bug-tar also?

No, this list is correct.  utime should not fail on an empty file, so
you've probably exposed a bug in cygwin1.dll.

Also, be aware that on cygwin, you _can't_ preserve symlink or directory
atimes, as the mere act of lstat'ing those files causes cygwin to make
windows syscalls that end up altering the access times on those types of
files (but generally, the atime on directories and symlinks is not as
interesting as the atime on regular files).

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110307/2ef460ad/attachment.sig>


More information about the Cygwin mailing list