Obtaining Actual File / Directory Names

Randall R Schulz rrschulz@cris.com
Sun Sep 15 11:02:00 GMT 2002


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/



More information about the Cygwin mailing list