delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/14/18:17:37

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: dalewking AT insightbb DOT com
To: cygwin AT cygwin DOT com
Subject: How to convert a path to the correct case
Date: Wed, 14 Sep 2005 22:17:21 +0000
Message-Id: <091420052217.14094.4328A1710006233B0000370E219791336309020705990A040E0B@insightbb.com>

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019