On May 30, 2009, at 4:35 PM, John E. Malmberg wrote:

Craig A. Berry wrote:
On May 30, 2009, at 12:39 PM, John E. Malmberg wrote:

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.

It may be accidentally expecting shared opens because no thought was given to it, but that's not what it's intended to test. I'm all for testing shared opens on VMS in some appropriate place when DECC $FILE_SHARING is enabled, but this is not the appropriate place. Even the space in a filename is just testing that File::Compare uses 3-arg open rather than 2-arg; there's no reason to run that test in an environment that can't handle the space. Turns out it's a little trickier than I thought to determine that, but that's still the best way forward.

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.

I think IO->flush is doing what it's designed to do, but that does not include fsync() (by design).

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.


OK, let's do that, but let's not increase the size of the test script by 50% with OS-specific code that occludes what is really being tested.

________________________________________
Craig A. Berry
mailto:craigbe...@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Reply via email to