This is the mail archive of the cygwin@cygwin.com 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]

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/


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