Michael G Schwern wrote:
On Wed, Jun 04, 2003 at 10:23:58AM -0500, Ken Williams wrote:

Well, your technique of reading the entire directory just to get the proper-case name of a single file is no Cat Pajama Suit either.

The only real way to handle it properly if you have no advance knowledge of the filesystem is to query the OS for the proper casing. Mac OS X has this ability, it's probably available in other case-insensitive case-preserving environments too if we wanted to bother with it.


A far simpler thing to do is just write out a mixed-case filename and
see what you get back from readdir() to test for case preservation.  For
case sensitivity, just write out a filename and try to open it with a
different casing.

I plan on creating a module to do this sort of file system probing after
I finally get a stable version of MakeMaker out the door.

This would be a useful thing to have as a part of the File::Spec toolkit.


die "oh my god" if File::Spec::CASE_INSENSITIVE_FS;



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to