develooper Front page | perl.perl5.porters | Postings from July 2008

Re: [ #37251] File::Spec->case_tolerant works only onsystems where one filesystem type is installed

Thread Previous | Thread Next
John E. Malmberg
July 3, 2008 12:09
Re: [ #37251] File::Spec->case_tolerant works only onsystems where one filesystem type is installed
Message ID:
Craig A. Berry wrote:
> On Thu, Jul 3, 2008 at 2:26 AM, Reini Urban <> wrote:
>> The problem is: What is the first arg and the default arg for
>> case_tolerant on VMS?
>> For Win32 it's the driveletter, default "c:", jan wants $ENV{SYSTEMDRIVE})
>> for cygwin/unix it's the mount point as in /etc/fstab, default "/"
>> for VMS? for ODS-5 I would just make it overridable for now. or use a
>> saner default.

I meant to respond to this earlier, but I got distracted.  I have almost 
got Twiki running on VMS.

Currently File::Spec->case_tolerant on VMS is not defined to take an 
argument.  I think, but have not tested it that it will ignore the argument.

In a previous proposal to the Perl 5 Porters list, I asked if there were 
any objections to having the case_tolerant method take an argument to 
change the case tolerant setting.  No one seemed opposed to it, but I 
never got to that task.

Your new code has the case_tolerant taking a parameter of the file 
system that it wants the answer to.

Until more work is done on the VMS port, the answer on VMS should 
probably still be hard coded to be 1 for case_tolerant behavior.

> If you want to default to the system disk, you can use sys$sysdevice,
> but as John said, case sensitivity is an attribute of a process and
> not of a disk volume.  As of 5.10.0, the process setting is available
> via VMS::Filespec::case_tolerant_process().  I suppose the correct
> behavior is that if we can get at that setting and if it returns
> false, then File::Spec->case_tolerant returns false.  Otherwise it
> returns true.  I suppose we can just ignore the argument.

I have not tested the behavior of a process set to use exact case on an 
volume that does not support it.

And perl is currently pretending VMS filenames are stored in 
lowercase[1], when they really are in upper case on the older volumes. 
The newer volumes preserve case.  The problem is that until we actually 
fully resolve a path to a physical disk, we can not predict if the case 
will be preserved or not, or if we should translate it.

[1]I think that under some cases if Perl (vms.c) already finds lower 
case letters in a file spec, it leaves it the case it was reported.

> I think Schwern once did a case tolerant probe empirically -- not sure
> how slow it was.

I remember him proposing such a check in a thread.  He also wanted a 
method to get various system properties.

>> Should all the core libs be updated to use this enhancement,
>> or just user-code which really need it?
>> Think of Module::Build (the worst) and Module::Install

It should be used in place of checking the OS type where practical.

> What exactly do you want to do differently when case tolerance is
> available as opposed to when it's not?

Also case tolerant does not imply case preserved in a file system.

The VMS ODS-5 can be case tolerant, and the VMS ODS-2 filesystem is 
case-tolerant.  But only the VMS ODS-5 filesystem supports case 

With out case preserving, readdir and glob() can return different case 
filenames than perl remembers writing.  And even with case preserving, a 
file of 'FooBar' overwritten by a open/write to 'fooBAR' may remain 
named 'FooBar' on the disk.

Personal Opinion Only

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About