This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Obtaining Actual File / Directory Names
- From: Randall R Schulz <rrschulz at cris dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 15 Sep 2002 09:53:39 -0700
- Subject: Obtaining Actual File / Directory Names
Hi,
Given Igor's fixed cygwin (or any subsequent release with that fix -- and,
of course, the one about the missing newline from the end of the help
output that I reported and Chris F. stated he fixed a few weeks back), one
can obtain the "real" name of a existing file or directory (i.e.,
respecting actual alphabetic case) like this:
realCase() {
cygpath -w -l "$(cygpath -d "$1")"
}
Example:
% touch "thisNameIsPrettyLongAndHasMixedCaseAndAFunkyCh&racter"
% realCase thisnameisprettylongandhasmixedcaseandafunkych\&racter
thisNameIsPrettyLongAndHasMixedCaseAndAFunkyCh&racter
Quoting and options are "exercises for the reader."
I can only confirm that this works as intended on a Windows 2K Pro (the
only system to which I have access).
Randy
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/