utime: still with bug?

A

Axel Friedrich

Hello,

with ruby 1.8.4 on Windows XP, there seems still to be an error of 1
hour when assigning mtime to a file by using utime.

Condition: Assigning a daylight saving time while actual time is not
daylight saving time.

The same seems to be OK on Windows 98SE.

I tested it as described in:
<longLine>
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/fe4a0
342986ebd71
</longLine>


Is there a fix or work-around?


I'm using:
ruby 1.8.4 (2005-12-24) [i386-mswin32] on both systems.


Axel
 
H

H.Yamamoto

Hello.
Hello,

with ruby 1.8.4 on Windows XP, there seems still to be an error of 1
hour when assigning mtime to a file by using utime.

Condition: Assigning a daylight saving time while actual time is not
daylight saving time.

The same seems to be OK on Windows 98SE.

I tested it as described in:
<longLine>
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/fe4a0
342986ebd71
</longLine>


Is there a fix or work-around?


I'm using:
ruby 1.8.4 (2005-12-24) [i386-mswin32] on both systems.


Axel

Sorry, this is regression I introduced when fixed another bug of stat(2) on WinNT.

Index: win32.c
===================================================================
RCS file: /src/ruby/win32/win32.c,v
retrieving revision 1.186
diff -u -w -b -p -r1.186 win32.c
--- win32.c 24 Feb 2006 02:19:44 -0000 1.186
+++ win32.c 2 Mar 2006 03:39:48 -0000
@@ -3223,6 +3223,7 @@ filetime_to_unixtime(const FILETIME *ft)
tm.tm_hour = st.wHour;
tm.tm_min = st.wMinute;
tm.tm_sec = st.wSecond;
+ tm.tm_isdst = -1;
t = mktime(&tm);
return t == -1 ? 0 : t;
}

I'll commit this on CVS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top