This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to rename file case-sensitive?

On Mon, 13 Aug 2007, Ronald Fischer wrote:

> Is there an easy way to rename a file foo to Foo?
> mv foo Foo
> complains that they are the same file. From the FAQ
> I learned that this is due to the limitations of
> Windows which does not distinguish between case
> in file names. The FAQ also says that there is a
> "highly experimental" case-sensitive file system
> available.
> Not being prepared yet to live in a highly
> experimental way, I'm curious whether there
> is a simpler solution to the rename problem
> aside from the obvious hack
>   mv foo bar; mv bar Foo

I use the following (which is essentially a wrapper around the hack):

$ cat /usr/local/bin/mvv
/bin/mv "${1%%/}" "${1%%/}-$$" && mv "${1%%/}-$$" "${2%%/}"

      |\      _,,,---,,_ |
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

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]