Preceptor has asked for the wisdom of the Perl Monks concerning the following question:
The problem is, this list was generated from a Windows view of the relevant filesystem (It's a NAS) and so the list is not case sensitive. (eg. I have /fs008/Localusers rather than /fs008/LocalUsers)
My question is, is there a simple way to 'convert' the filename that's got the right sequence of characters, but not quite the same case, to the 'correct' filename?
I can'd do anything as simple as converting it all to upper/lower case, because for legacy reasons, our Unix filesystems do include a mix of upper and lower case directories.
I'm fairly confident that there are going to be no 'duplicates' (eg. Having "thisfile" and "ThisFile" in the same directory) since these filesystems are exported via both CIFS and NFS.
The only way I can immediately think of involves generating all possible permutations of case, and testing for the existence of the file.
(Oh, and the filenames have spaces in too, in places. But that's less of a problem)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: case insensitive filename matching
by cog (Parson) on Feb 10, 2005 at 12:35 UTC | |
by edan (Curate) on Feb 10, 2005 at 13:37 UTC | |
by cog (Parson) on Feb 10, 2005 at 13:45 UTC | |
Re: case insensitive filename matching
by Fletch (Bishop) on Feb 10, 2005 at 13:03 UTC | |
Re: case insensitive filename matching
by holli (Abbot) on Feb 10, 2005 at 13:49 UTC | |
by Preceptor (Deacon) on Feb 14, 2005 at 10:22 UTC | |
Re: case insensitive filename matching
by RazorbladeBidet (Friar) on Feb 10, 2005 at 13:13 UTC |