Randy Kobes wrote:
Thanks very much for the explanation, Steve - that makes
sense. So as was mentioned earlier, this problem probably
won't be encountered by the majority of Win32 users,
who will be unpacking a CPAN distribution. It is
annoying for svn users though who may encounter this
problem - would the following patch be OK, which uses
the generated httpd.conf as the file?
The patch works OK for me (and, as you say, we don't need the utime()
call any more either.)
It might just be worth checking if there was any particular reason that
$file was __FILE__ first, though: in (much) earlier versions of mp2 it
used to be t/htdocs/index.html. Unless there was some specific reason
for that change then I think this patch is fine.
====================================================
Index: finfo.pm
===================================================================
--- finfo.pm (revision 410430)
+++ finfo.pm (working copy)
@@ -30,7 +30,11 @@
sub test {
- my $file = __FILE__;
+ # for the file to be tested, use the httpd.conf generated
+ # by testing, so that it has a ctime that won't (usually)
+ # encounter a bug in Win32's stat() function for files that
+ # span across DST season boundaries.
+ my $file = catfile Apache::Test::vars->{t_dir}, 'conf', 'httpd.conf';
# On Win32, touch the file to ensure it is in the same Daylight Saving
# Time season as the current time to workaround a bug in Win32's
stat()
===========================================================
With this patch, there's no need (for me) to have the
if (WIN32) {
my $now = time;
utime $now, $now, $file;
}
immediately following this chunk, as using httpd.conf
addresses the same problem as this does.
------------------------------------------------
Radan Computational Ltd.
The information contained in this message and any files transmitted with it are
confidential and intended for the addressee(s) only. If you have received this
message in error or there are any problems, please notify the sender
immediately. The unauthorized use, disclosure, copying or alteration of this
message is strictly forbidden. Note that any views or opinions presented in
this email are solely those of the author and do not necessarily represent
those of Radan Computational Ltd. The recipient(s) of this message should check
it and any attached files for viruses: Radan Computational will accept no
liability for any damage caused by any virus transmitted by this email.