[wplug] case utility

Jonathan Billings jsbillings at gmail.com
Tue Apr 5 10:48:42 EDT 2005


On Apr 4, 2005 3:45 PM, Teodorski, Christopher
<Christopher.Teodorski at ddiworld.com> wrote:
> Here is my attempt at an explanation of the particular issue at hand:
> 
> A web application was written for Windows.  Thus allowing said
> developers to play fast and loose with case, i.e. the file name is
> myimage.jpg -- however in the code, it is referred to as MyImage.jpg and
> myImage.jpg and mYiMage.jpg.    This works fine in Windows because as we
> all know Windows is case insensitive (except when it isn't).

So, does this web application run on the web server, and access the
files directly, or does it use the HTTP protocol to talk to the web
server to find files?

Also, does it try to access the same file with different cases in
different parts of the application?

> However, this application is looking for a new home on a *nix box and
> features many 404's now because of the above mentioned case issue when
> run on *nix.
> 
> The question is:  Is there a good way to grab a filename from a
> directory -- and match it regardless of case within all files in the
> directory and if a match is found replace it with the proper case.
> 
> It sounds to me like a job for Perl -- but I'm a Perl noob and it'd take
> me some serious time to get my head wrapped around this (although I'm
> going to give it the old college try).

It's not clear how this application is accessing the files.  As
several people have mentioned, you can replace all the files with
lower-case versions of the files, but I suspect that this program
isn't just looking for one case, so that won't solve it.  Also,
there's the mod_speling module for apache, but if your application is
accessing the files directly, it won't help.  It sounds like you want
to either make the file system case-insensitive, or have some sort of
wrapper code around the application that intercepts all file access
calls, and try to find the appropriate file.  Am I understanding you
correctly?


-- 
  Jonathan Billings
jsbillings at gmail.com


More information about the wplug mailing list