On Wed, 31 May 2006, Steve Hay wrote:
> Unfortunately, Perl arguably doesn't get it right,
which is the reason for
> the existence of my Win32::UTCFileTime module
> There is a difficulty in deciding what is
"right", though. The real problem
> is MS's crap CRT library: its stat() function returns
definitively wrong file
> times across DST season boundaries, which leaves
anything wrapping that
> stat() function with a dilemma:
> - Should the wrapper try to be portable, ironing out
the idiosyncracies of
> the various systems on which it is built, so as to
always yield the same
> answer? (This is understandably the approach that APR
has taken, that being
> largely the point of it.)
> - Or should the wrapper be a thinner, less
interventionist layer that seeks
> only to expose the underlying system behaviour to some
new interface? (This
> is the approach that Perl has taken, simply exposing
the CRT library
> function, with all its quirks and foibles, to Perl.)
> So just don't go waiting around for APR to be
"fixed", because I doubt very
> much that its authors consider it to be broken.
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?
====================================================
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->,
'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.
--
best regards,
Randy
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe perl.apache.org
For additional commands, e-mail: dev-help perl.apache.org
|