As you may know, Windows has case-insensitive file system.
Below you can see the function that gives you case-sensitive filename by possible case-insensitive path.
|
|
Function GetCaseSensitivePath:String( path:String ) #If __HOSTOS__="windows" Local dir:=ExtractDir( path ) Local items:=LoadDir( dir ) If items Local lower:=StripDir( path ).ToLower() For Local i:=Eachin items If i.ToLower()=lower Return dir+i Next Endif Return path #Else Return path #Endif End |
NOTE: there is a fix for a filename part of path only, casing of directory part remains as is.