https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2012-05-03T13:30:45Z
Ruby Issue Tracking System
Backport193 - Backport #6385: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows
https://bugs.ruby-lang.org/issues/6385?journal_id=26412
2012-05-03T13:30:45Z
mame (Yusuke Endoh)
mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>usa (Usaku NAKAMURA)</i></li></ul>
Backport193 - Backport #6385: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows
https://bugs.ruby-lang.org/issues/6385?journal_id=26417
2012-05-03T14:38:33Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/26417/diff?detail_id=19528">diff</a>)</li><li><strong>Category</strong> set to <i>core</i></li><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Feedback</i></li></ul><p>=begin<br>
I can't reproduce this issue in JST, which does not have DST.<br>
In what timezone are you?<br>
=end</p>
Backport193 - Backport #6385: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows
https://bugs.ruby-lang.org/issues/6385?journal_id=26431
2012-05-04T05:44:21Z
jonforums (Jon Forums)
<ul></ul><p>This oddity on Win7 32bit may be related...</p>
<p>C:\Users\Jon\Documents\RubyDev\sandbox>ruby --version<br>
ruby 1.9.3p202 (2012-04-27 revision 35484) [i386-mingw32]</p>
<p>C:\Users\Jon\Documents\RubyDev\sandbox>ripl</p>
<blockquote>
<blockquote>
<p>open('tst', 'w') { |f| f.write '123' }<br>
=> 3<br>
atime = Time.utc(2012)<br>
=> 2012-01-01 00:00:00 UTC<br>
mtime = Time.utc(2011)<br>
=> 2011-01-01 00:00:00 UTC<br>
File.utime(atime, mtime, 'tst')<br>
=> 1<br>
s = File.stat('tst')<br>
=> #<File::Stat dev=0x2, ino=0, mode=0100644, nlink=1, uid=0, gid=0, rdev=0x2, size=3, blksize=nil, blocks=nil, atime=2011-12-31 18:00:00 -0500, mtime=2010-12-31 18:00:00 -0500, ctime=2012-05-03 16:26:21 -0400><br>
atime<br>
=> 2012-01-01 00:00:00 UTC<br>
s.atime<br>
=> 2011-12-31 18:00:00 -0500<br>
mtime<br>
=> 2011-01-01 00:00:00 UTC<br>
s.mtime<br>
=> 2010-12-31 18:00:00 -0500</p>
</blockquote>
</blockquote>
<p>And I've noticed this as part of <code>make test-all TESTS='pathname'</code></p>
<ol start="14">
<li>Failure:<br>
test_utime(TestPathname) [c:/Users/Jon/Documents/RubyDev/ruby-git/test/pathname/test_pathname.rb:934]:<br>
<2000-01-01 00:00:00 UTC> expected but was<br>
<1999-12-31 18:00:00 -0500>.</li>
</ol>
Backport193 - Backport #6385: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows
https://bugs.ruby-lang.org/issues/6385?journal_id=26614
2012-05-14T15:04:19Z
kolmanv (Kolman Vornovitsky)
kolmanv@gmail.com
<ul></ul><p>Here is my run on the same code seems to work :<br>
Maybe the problem is at Time.at<br>
kolman@KOLMAN-PC ~<br>
$ irb<br>
irb(main):001:0> open('tst', 'w') { |f| f.write '123' }<br>
=> 3<br>
irb(main):002:0> atime = Time.utc(2012)<br>
=> 2012-01-01 00:00:00 UTC<br>
irb(main):003:0> mtime = Time.utc(2011)<br>
=> 2011-01-01 00:00:00 UTC<br>
irb(main):004:0> File.utime(atime, mtime, 'tst')<br>
=> 1<br>
irb(main):005:0> s = File.stat('tst')<br>
=> #<File::Stat dev=0x2, ino=0, mode=0100644, nlink=1, uid=0, gid=0, rdev=0x2, size=3, blksize=nil, blocks=nil, atime=2012-01-01 02:00:00 +0200, mtime=2011-01-01 02:00:00 +0200, ctime=2012-05-14 08:41<br>
:26 +0200><br>
irb(main):006:0> atime<br>
=> 2012-01-01 00:00:00 UTC<br>
irb(main):007:0> s.atime<br>
=> 2012-01-01 02:00:00 +0200<br>
irb(main):008:0> mtime<br>
=> 2011-01-01 00:00:00 UTC<br>
irb(main):009:0> s.mtime<br>
=> 2011-01-01 02:00:00 +0200<br>
irb(main):010:0> s.mtime.utc<br>
=> 2011-01-01 00:00:00 UTC</p>
Backport193 - Backport #6385: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows
https://bugs.ruby-lang.org/issues/6385?journal_id=26618
2012-05-14T21:40:18Z
djberg96 (Daniel Berger)
<ul></ul><p>Are we talking about this?</p>
<p><a href="http://search.cpan.org/~shay/Win32-UTCFileTime-1.55/lib/Win32/UTCFileTime.pm#DESCRIPTION" class="external">http://search.cpan.org/~shay/Win32-UTCFileTime-1.55/lib/Win32/UTCFileTime.pm#DESCRIPTION</a></p>
Backport193 - Backport #6385: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows
https://bugs.ruby-lang.org/issues/6385?journal_id=26634
2012-05-15T17:58:05Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul></ul><p>=begin<br>
: kolmanv (Kolman Vornovitsky) wrote:<br>
Here is my run on the same code seems to work :<br>
Maybe the problem is at Time.at<br>
kolman@KOLMAN-PC ~<br>
$ irb<br>
irb(main):001:0> open('tst', 'w') { |f| f.write '123' }<br>
=> 3<br>
irb(main):002:0> atime = Time.utc(2012)<br>
=> 2012-01-01 00:00:00 UTC<br>
irb(main):003:0> mtime = Time.utc(2011)<br>
=> 2011-01-01 00:00:00 UTC<br>
irb(main):004:0> File.utime(atime, mtime, 'tst')<br>
=> 1<br>
irb(main):005:0> s = File.stat('tst')<br>
=> #<File::Stat dev=0x2, ino=0, mode=0100644, nlink=1, uid=0, gid=0, rdev=0x2, size=3, blksize=nil, blocks=nil, atime=2012-01-01 02:00:00 +0200, mtime=2011-01-01 02:00:00 +0200, ctime=2012-05-14 08:41:26 +0200><br>
irb(main):006:0> atime<br>
=> 2012-01-01 00:00:00 UTC<br>
irb(main):007:0> s.atime<br>
=> 2012-01-01 02:00:00 +0200<br>
irb(main):008:0> mtime<br>
=> 2011-01-01 00:00:00 UTC<br>
irb(main):009:0> s.mtime<br>
=> 2011-01-01 02:00:00 +0200<br>
irb(main):010:0> s.mtime.utc<br>
=> 2011-01-01 00:00:00 UTC</p>
<p>Thank you, I could reproduce it with 1.9.3p179, by changing the system<br>
timezone to "((%(UTC+02:00) Athens, Bucharest%))".</p>
<p>But it seems fixed already in the trunk.</p>
<p>=end</p>
Backport193 - Backport #6385: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows
https://bugs.ruby-lang.org/issues/6385?journal_id=26635
2012-05-15T17:59:17Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Backport</i></li><li><strong>Project</strong> changed from <i>Ruby master</i> to <i>Backport193</i></li><li><strong>Category</strong> deleted (<del><i>core</i></del>)</li><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>usa (Usaku NAKAMURA)</i> to <i>luislavena (Luis Lavena)</i></li></ul>
Backport193 - Backport #6385: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows
https://bugs.ruby-lang.org/issues/6385?journal_id=26683
2012-05-18T00:05:04Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r35678.<br>
Kolman, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>merge revision(s) 35109,35110,35651: [Backport <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: mtime vie File.stat(filename).utime vs File.open(filename, 'r').mtime in Windows (Closed)" href="https://bugs.ruby-lang.org/issues/6385">#6385</a>]</p>
<pre><code>* win32/win32.c (rb_w32_fstat, rb_w32_fstati64): convert FILETIME
to time_t directly, not to be affected by TZ unnecessarily.
* win32/win32.c (unixtime_to_filetime): convert time_t to FILETIME
simply.
</code></pre>