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]

How to convert a path to the correct case


Cygwin itself is case preserving, but case insensitive. Other tools are not so
flexible on case. In my case I have some issues with incorrect case and my makefile.

Consider if I had a directory /foo/BAR. Cygwin will let you actually do "cd
/Foo/bar" and work happily. Pwd will actually return "/Foo/bar" instead of the
real path in this case.

It would be really helpful to have a way given a string like "/Foo/bar" to
convert that to the real correct case "/foo/BAR".

But I'm having trouble finding an easy, convenient way to do that. As I said pwd
doesn't do it nor does cygpath.

One way that works is to turn the path into a pattern. You can do "ls /Foo/bar*"
but that will return multiple strings if there is more than one file that starts
with BAR. You can do "ls /Foo/ba[r]" but then how do I easily add the brackets
into the string? I've tried various things with find, but none do the conversion.

Anyone have a good idea how to do this conversion.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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