This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: New rename(2) function
On Fri, 10 Aug 2007, Eric Blake wrote:
> According to Christian Franke on 8/10/2007 2:37 PM:
> >
> > But be aware: If there are hard links, things get really worse:
> >
> > $ touch Foo
> >
> > $ ln Foo Fool
> >
> > $ mv -v Foo foo
> > removed `Foo'
>
> Ouch. Coreutils decided that since Foo and foo represent the same file
> (and on a case-insensitive system, they do), and since Foo has more than
> one link, that it was safe to unlink Foo because the data would be left in
> foo. But how is coreutils supposed to know when a file system is
> case-insensitive, such that unlinking Foo is the wrong action? In other
> words, how do you distinguish between two spellings of the same directory
> entry, which is a different matter than two directory entries to the same
> inode?
>
> [snip]
>
> > This is probably not POSIX compliant ;-)
>
> Ah, but POSIX requires a case-sensitive file system. So you already left
> the realm of POSIX in the first place long before the rename(2) or mv(1),
> since in POSIX stat("foo") would have failed rather than coming back
> identical with stat("Foo").
And this is why I always use check_case:strict. Yes, it's slower, but at
least I won't end up accidentally removing (or overwriting) a file that I
didn't know existed because it has a different case...
Now, if only I could convince vim to not use case-insensitive
completion...
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
|,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
Belief can be manipulated. Only knowledge is dangerous. -- Frank Herbert