Eric Blake <[EMAIL PROTECTED]> writes:

> I maintain that Linux is still
> POSIX-compliant by allowing rename("a", "b/") to succeed

It does appear that POSIX does not specify what should happen when you
do this:

mkdir new
cd new
touch a
mv a b/c

That is, if "b" does not exist, then rename("a", "b/c") is not
required to fail.  That's very strange, but there's nothing in the
existing language that requires it to fail.

Hence you are right: rename("a", "b/") is not required to fail either.

I view this as a defect in POSIX.

> rename("a", "b/.") must fail since "b/." has a trailing dot component

I see no difference here.  POSIX allows rename("a", "b/.") to succeed,
using the same logic as above.


> We should probably bring this up on the austin mailing list.

Yes, probably.


>> B.  Have 'mv' do whatever 'rename' does, even if 'rename' does not
>>     conform to POSIX.

> I also would favor (B).  But we certainly need testsuite additions to
> ensure that we don't introduce future regressions against this decision.

OK, it'll be harder to test (B), since that relies on the test suite
knowing what rename() does.  But I guess we can work around that.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to