walk_dir: upper & mixed case problem in "equal" test
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Sep 10, 2000
- 373 views
I'm trying to use walk_dir to find the path for a specified file, and I'm having trouble getting my program to *recognize* when it's found the file, because of difficulty with uppercase/lowercase as perceived & reported by walk_dir, and then tested by "equal". It seems that sometimes when a file is created, its filename is created in a format which is read by walk_dir as ALL UPPERCASE, (such as all the Euphoria files distributed by RDS), although they DON'T display that way on all systems (ie, Win98) when shown in a directory listing (ie, they show as all lowercase except for the first character); however, sometimes (perhaps when the file is created on Win98 system or something?), the filename *as reported by walk_dir* can be in a *mixture* of upper and lowercase, which is like it IS displayed in a directory listing on the system. So the upshot is, if a person goes to use the routine, and types in the file name to find, if they don't type it in exactly the form it is returned by walk_dir (all uppercase, all lowercase, or *mixture*), I can't get the routine to recognize that it has found it. I presume I could make some routine to take each file name as reported by walk_dir and create *every* possible combination of upper/lower case for every character in it, to do the test against the target filename, but this seems like it would make the walk_dir take a LOT longer to do. Can anyone suggest a better approach? Thanks, Dan Moyer