in reply to Re: Search for file ignore case
in thread Search for file ignore case


I've the file name ( get it from some function), an example: TeSt.Mak

The file is existing under the directory (e.g: test.mak), but can appear with the same name but mixed case.
I need to retrieve the correct file name as it appears under the directory.

Replies are listed 'Best First'.
Re^3: Search for file ignore case
by ikegami (Patriarch) on May 18, 2008 at 19:45 UTC

    In Windows, you can use GetLongPathName in Win32.

    >copy nul test.mak 1 file(s) copied. >perl -le"use Win32; print Win32::GetLongPathName('TeSt.Mak');" test.mak
      i need it for unix :-(
        Then use of the four other solutions already provided in the thread. If you don't want to do a recursive search, then just use opendir.