bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request, mv


From: Eric Blake
Subject: Re: Feature request, mv
Date: Thu, 11 May 2006 03:14:25 +0000

> 
> Once it knows the target (b) is a directory, if you're using -T, mv knows
> that it must fail -- rename ("anything", "directory") will always fail.

Only if "directory" is not empty.  POSIX requires "If the old argument
points to the pathname of a directory, the new argument shall not
point to the pathname of a file that is not a directory. If the directory
named by the new argument exists, it shall be removed and old
renamed to new. In this case, a link named new shall exist throughout
the renaming operation and shall refer either to the directory referred
to by new or old before the operation began. If new names an existing
directory, it shall be required to be an empty directory."

Therefore, we have found another 'mv -f -T' bug:

$ mkdir dir other
$ mv -fT other dir

should succeed, not fail.

-- 
Eric Blake




reply via email to

[Prev in Thread] Current Thread [Next in Thread]