Re: Resend, lib/file/compare.t patch for VMS.

"John E. Malmberg" <[email protected]>
Newsgroups gmane.comp.lang.perl.ports.vms,gmane.comp.lang.perl.perl5.porters
Message-ID <[email protected]>
Craig A. Berry wrote:
> 
> On May 30, 2009, at 12:39 PM, John E. Malmberg wrote:
> 
>> The lib/file/compare.t test has never been correct for VMS, but the 
>> bugs where mostly hidden until testing on a ODS-5 volume with that 
>> allows filenames with more characters in them than VMS traditionally 
>> allows. This is known as EFS_CHARSET mode.
> 
> I think you are right that the test that intentionally has a space in 
> the filename is not working right in traditional mode.  The correct fix 
> would be to detect whether files with spaces in the name are actually 
> supported and skip that test if not.
> 
>> This also exposes that the vmsify() routine in the traditional VMS 
>> mode is not matching how the C library in VMS internally implements 
>> the equivalent function.
> 
> There are no explicit vmsify calls in the test, so I don't know what you 
> are referring to.

I am referring to the internal calls to convert Unix to VMS filenames in 
VMS.C which the vmsify() routine is a wrapper for.

The CRTL is discarding space characters found in UNIX format filenames 
when converting them to VMS.  The code that implements vmsify() does not 
do that.  If it had, this issue would have been seen before.

>> It also exposes that the flush() operation is a no-op on the VMS 
>> platform, which is something that needs to be fixed.
> 
> I don't think it's working any differently than anywhere else.  You may 
> be getting confused by the fact that calling flush() on a filehandle 
> only flushes the perlio buffers and does not implicitly do an fflush(), 
> much less an fsync(), on the underlying file descriptor.
> 
>> This issue with flush() has shown up before, but the test was modified 
>> to not use that algorithm.
>>
>> The DECC$FILE_SHARING feature needs to be active for this test to work 
>> when the EFS_CHARSET mode is on.  By default DECC$FILE_SHARING is off, 
>> and so far none of the other Perl tests need it enabled, even when in 
>> UNIX compatible mode.
> 
> Flushing and file sharing aren't really relevant.  When calling 
> File::Compare::compare with a filename rather than a handle, we just 
> need to make sure the file is closed first on VMS.  That's it.

This test is expecting that the data written to the file by one file 
handle can be read by the second file handle while the first file handle 
  is open.

According to X/Open, the only way to guarantee that is to call a fsync() 
call.  The IO->flush is the closest thing to that, and when I checked 
the source code a while back, I discovered that it was not doing anything.

We should be able to fix Perl on VMS so that this test runs the same way 
on VMS as it does on UNIX when the extended file specifications are 
active, and the UNIX file sharing mode is set.

For the traditional VMS mode, I think that the test should be modified 
or skipped, but for using extended file specifications, the original 
algorithm should work.

>> The last e-mail from Craig that I saw about the initial submission 
>> where he was not sure about the extra diagnostics, but was going to 
>> look it over, and I did not see a response to my more detailed post 
>> about patch and why these diagnostics are needed.
> 
> Sorry not to follow up in a timely fashion.  I'll try to do better this 
> time.  I have something mostly working that just needs a bit more testing.

Regards,
-John
[email protected]
Personal Opinion Only
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.