New rename(2) function

Christian Franke
Thu Aug 9 16:39:00 GMT 2007

On Aug 1, Corinna Vinschen wrote:
> On Aug  1 06:56, Eric Blake wrote:
>>> ...
>> Also, where do you check that rename("a","a") is a successful no-op, as
>> well as rename("a","b") when a and b are hard links to the same inode
>> (perhaps both of these cases are covered by NtSetInformationFile?)
> rename ("a", "a") is a no-op because NtSetInformationFile will just
> return with status 0, doing nothing.

On unmanaged mounts, rename ("a", "a") isn't always a no-op: If "A" 
exists, it is renamed to "a".

Works with rename() from Cygwin 1.5.24-2 and also with 2007-08-05 snapshot.

BTW: But changing letter case does not work with mv:

$ touch Foo

$ mv Foo foo
mv: `Foo' and `foo' are the same file

$ mkdir Bar

$ mv Bar bar
mv: cannot move `Bar' to a subdirectory of itself, `bar/Bar'

Probably, a case insensitive filesystem is not POSIX compliant at all ;-)


More information about the Cygwin-developers mailing list