develooper Front page | perl.perl5.porters | Postings from June 2013

utime with 'long' times on Win32

Thread Next
From:
alex.davies
Date:
June 10, 2013 21:20
Subject:
utime with 'long' times on Win32
Message ID:
FDB59B9E41D64348ACA806FF9FC3F279@Amelie
Hi All,

Recently was surprised by the following behaviour of Perl's utime
*on*windows*:

 c:\> perl -e "$t = 2**32; print scalar localtime $t"
 Sun Feb  7 06:28:16 2106
 c:\> perl -e "open T,'>xyz'; close T; $t = 2**32; utime $t,$t,'xyz' or die qq(... $!)"
 ... Invalid argument at -e line 1.

Specifically times >= 2**31 trigger EINVAL.

I don't see any reason why Perl shouldn't do The Right Thing here since
Windows supports such file times.
    
Now there may be an argument that we should mimic the clib's implementation
of utime()... but then that should also apply to localtime :-)

If there's interst, and no one else volunteers ("Hi Jan!") i'll take a closer look
and try to whip a patch together.


Cheers, alex.



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About