Case sensitive path problem
Posted 06 March 2003 - 15:38
Suppose you have a setup asks the user to insert a destination path (with default). For example the default is:
Suppose the user had already that path onto his pc only differing in capital letters. For example:
Suppose the user leave the default when he meet the SdAskDestPath dialog.
szDir = "C:\\COMPANY_NAME";
nResult = SdAskDestPath(szTitle, szMsg, szDir, 0);
Now szDir is "C:\\COMPANY_NAME" (unchanged)
Suppose I write szDir into registry for future purpose
Suppose another application read szdir from the registry
Suppose (another one? Yea the last but not the least!!! this application work with case sensitive logic, it looks for something in "C:\COMPANY_NAME" while the desire's object it's in "C:\company_name"
What could you do?
Please note you can't modify the "case sensitive" application, you can just work onto the istallation issue
Thanks to all,
Posted 06 March 2003 - 16:18
I'm sorry,but directories & filenames should never be case sensitive, so that other application is just plain wrong!!!
Posted 07 March 2003 - 08:18
Otherwise I have to:
1. acquire the user destination path (from dialog) into szDir
2. split them into each directory level:
3. goto root dir (C:\
4. if existdir "dir_level_1" (into file system) get "dir_level_1" (from file system) into a support string variable. Is there some built in function do that?
5. now into support string variable I have the "exact case" dir_level_1, I substitute it into szDir
6. repeat fot each level dir
a bit complex... but I have no other idea!
Thanks to all,
Posted 13 March 2003 - 20:28
Just use the StrToLower and StrToUpper functions (function details are in the IS help index). If you need the path in the registry to be upper case in order for your other app to read it properly, simply call the StrToUpper function before you write the path the user has entered to the registry. The functions will convert full file paths so you won't need to parse out each section individually unless you need part of it upper and part of it lower (ie C:\test\COMPANY_NAME)
For example, the StrToUpper function will convert your string "C:\company_name" to "C:\COMPANY_NAME" and it would convert "C:\test\company_name" to "C:\TEST\COMPANY_NAME"
Posted 14 March 2003 - 16:58
Posted 14 March 2003 - 18:43