Hello,
Win32::UTCFileTime::stat() returns a wrong zero atime/ctime/mtime value
in some situations.
I encountered the problem when checking timestamps in a custom Perl
script for a file mirror. Only very few files are affected, and it seems
that the output is only wrong in those cases where normal stat() suffers
from the known DST problem.
The files in question are located on a network drive.
Behaviour is as follows:
1/ normal (C-runtime) stat() returns valid atime/ctime/mtime values
2/ Win32::UTCFileTime::stat() returns zero times for the same file
3/ normal (C-runtime) stat() returns zero atime/ctime/mtime values also
when Win32::UTCFileTime is *only* loaded ("use Win32::UTCFileTime;" at
start of Perl script) and normal stat() is used afterwards. So there
seems to be a side-effect on normal stat() in this case.
I also tried to use Win32::UTCFileTime::alt_stat(). In that case, I get
an error $ErrStr that says
"Can't open file ... for reading: The process cannot access the file
because it is being used by another process at checkstat.pl line 21".
The following table summarzies the output of 1/2/3/ above:
normal stat(): UTC-stat(): normal stat()
w/ UTC-package loaded
info stat() stat() stat()
dev: 2 2 2
ino: 0 0 0
mode: 33206 33206 33206
nlink: 1 1 1
uid: 0 0 0
gid: 0 0 0
rdev: 2 2 2
size: 56832 56832 56832
atime: 1215510518 0 0
mtime: 1215510518 0 0
ctime: 1197889620 0 0
blksize: 0 0 0
blocks: 0 0 0
In the attached zip file, you will find "checkstat.pl" that I used for
checking this problem.
I am using
o Win32-UTCFileTime-1.48
o (ActiveState) perl5.10.0 (see zip file perl-v.txt for full information).
Any help highly appreciated. If this is of any help, I can perform
further runs for debugging purposes of course.
Subject: | stat.zip |