[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: merge rename and rename-dest-slash
From: |
Eric Blake |
Subject: |
Re: merge rename and rename-dest-slash |
Date: |
Mon, 07 Sep 2009 11:12:18 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 9/7/2009 10:30 AM:
> Any objections to deleting the rename-dest-slash module? It performs a
> subset of the rename module,
Correction. As currently written, rename.m4 checks whether:
rm -rf d1 d2
mkdir d1
rename("d1/","d2")
fails, but POSIX 2008 permits this case, so the test is wrong. But POSIX
_does_ require
rm -rf d1 d2
touch d1
rename("d1/","d2")
to fail (in other words, the existing code needs to account for whether a
directory is being renamed, rather than blindly rejecting trailing slash).
Meanwhile, rename-dest-slash.m4 checks whether:
rm -rf d1 d2
mkdir d1
rename("d1","d2/")
fails, which POSIX 2008 does indeed require to fail. But note:
rm -rf d1 d2
mkdir d1 d2
rename("d1","d2/")
is required to pass. All of this is independent of the cygwin 1.5 bug,
where POSIX requires any rename attempt targeting an explicit . or .. to
fail with EINVAL.
I guess it's time for me to add a unit test.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkqlPvIACgkQ84KuGfSFAYCxZACgsXNKwV8AjPrPTZPN0dfHEeIX
gfMAnAx25gaUe73an4YHzI+bi5vaOcVq
=BknH
-----END PGP SIGNATURE-----