As we all know Linux is unlike Operating systems like Windows case sensitive. One the one hand this is good because it's more accurate but it's a pain when people forget Windows isn't the only OS. This is why I need your help. I am in need of a snippet: A snippet that turns a string of a path with a random case into a string with the right case. Vague? Let me clarify.
It will be for a webserver. Say someone calls http://myhost.com/dir/FoO.ZiP
. Windows wouldn't care about this and serve the file. Unix/Linux will however tell us that the file doesn't exist. I still want to serve it the file, so I was wondering if there is a way to turn the string of the random case into a string with the real case, of the existing file. It wont be required to do this for the directory too, however that would be cool if it isnt too much work.
The person who solves this will get 100 points. It's not amazingly much and if the assignment turns out to be more complex I might add some to it. (Im new to this community, forgive my newbieness heh ;))
Thanks in advance!