Craig A. Berry wrote:
At 7:51 PM -0400 8/31/05, John E. Malmberg wrote:
Test 20 of lib/File/Copy.t is failing on VMS because the copied
file has not inherited the creation date from the original file.
Unless I'm looking at the wrong test, it's not creation time, but
rather mtime, which is the last time the contents of the file were
modified (probably ATR$C_REVDATE unless POSIX timestamps are enabled
on an ODS-5 disk). And even though the test description says "mtime
preserved by copy()", it's not testing copy() but rather move().
Ok, one part of the fix will be to change the error message to match the
test.
If you simply rename a file, it does seem that mtime ought to stay the
same. Not sure why that's not working on VMS.
I do now, it is a documented feature in the CRTL.
This test will only pass now on VMS if three conditions exist.
1. The test directory is an ODS-5 volume.
Also I do not know how to determine from Perl if the volume is an ODS-5
volume, as Perl does not seem to have implemented statvfs().
2. The hardware is not a VAX.
I do not yet know how to look that up in a Perl script. My suspicion is
that I will find something in config.
3. The feature DECC$EFS_FILE_TIMESTAMPS is enabled.
The DECC$EFS_FILE_TIMESTAMPS is one of the features that must be enabled
before main() is entered, so unless someone changes the pre-main init
code in VMS.C, the test $ENV{'DECC$EFS_FILE_TIMESTAMPS'} having the
first character being any one of "EeTt1" will determine if the feature
is active.
I am sure that test would be a simple Perl syntax for someone more
experienced at Perl programming than I have.
Essentially, the modification time field only exists on an ODS-5 volume.
On an ODS-2 volume, there is a revision time field and that is used
instead of the modification time field. A rename() operation updated
the modification time field.
The revision time field is updated on any change to the file.
The modification time field is only updated if the data in the file changes.
It might be possible to make a wrapper to rename() on VMS to save and
preserve the revision time after the rename. IMHO, it is not worth the
effort. Better just to document the issue.
Now as to the test, the simple thing is to always skip it for VMS, and
the next thing would be to only skip it if all three conditions are
present for it to be run.
-John
[EMAIL PROTECTED]
Personal Opinion Only