utime bug help?

Discussion in 'Ruby' started by Axel Friedrich, Oct 31, 2005.

  1. Hello,

    in some cases, utime does not set the mtime correctly. AFAIK, this
    bug is known for quite a while. - Anybody knows, if it will be fixed
    in the near future or if there is a patch or any other help?

    I could not find help in the archive of this newsgroup, even this:
    http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/24
    9839f5de0c6278/f30f387c97157f50
    seems not to help in my case. I also could not find it in the
    bugtracker,
    http://rubyforge.org/tracker/?group_id=426 .


    Ruby-Version: ruby 1.8.2 (2004-12-25) [i386-mswin32]
    on Windows 98SE


    Code I use to identify the bug:

    # create a file
    fileName = "c:/test.txt"
    puts( fileName )
    File.open( fileName, "w" ) {|file| file.write( "test bla bla") }


    puts "\n--- The following time is daylight saving time ---"
    mtime1 = Time.at(1089870492)
    puts mtime1
    File.utime( Time.now, mtime1, fileName )
    mtime2 = File.mtime( fileName )
    puts mtime2

    puts "\n--- The following time is _not_ daylight saving time ---"
    mtime1 = Time.at( 1135539956 )
    puts mtime1
    File.utime( Time.now, mtime1, fileName )
    mtime2 = File.mtime( fileName )
    puts mtime2


    Returns:

    c:/test.txt

    --- The following time is daylight saving time ---
    Thu Jul 15 07:48:12 (MEZ) - Mitteleurop. Sommerzeit 2004
    Thu Jul 15 06:48:12 (MEZ) - Mitteleurop. Sommerzeit 2004 <- Not OK!

    --- The following time is _not_ daylight saving time ---
    Sun Dec 25 20:45:56 (MEZ) Mitteleuropäische Zeit 2005
    Sun Dec 25 20:45:56 (MEZ) Mitteleuropäische Zeit 2005


    I would like to know, if it will be fixed in the near future or if
    there is a patch or any other help?

    Axel

    --
    email to:
    axel . friedrich _ smail <> g m x . de
     
    Axel Friedrich, Oct 31, 2005
    #1
    1. Advertising

  2. Hi,

    At Tue, 1 Nov 2005 05:42:12 +0900,
    Axel Friedrich wrote in [ruby-talk:163542]:
    > in some cases, utime does not set the mtime correctly. AFAIK, this
    > bug is known for quite a while. - Anybody knows, if it will be fixed
    > in the near future or if there is a patch or any other help?


    I guess it has been fixed:

    Tue May 17 11:52:18 2005 NAKAMURA Usaku <>

    * win32/win32.c (unixtime_to_filetime): use localtime() instead of
    gmtime() when using FileLocalTimeToFileTime().

    --
    Nobu Nakada
     
    nobuyoshi nakada, Nov 1, 2005
    #2
    1. Advertising

  3. nobuyoshi nakada <> wrote in
    news:2k.ad.ge.com:

    > I guess it has been fixed:
    >
    > Tue May 17 11:52:18 2005 NAKAMURA Usaku <>
    >
    > * win32/win32.c (unixtime_to_filetime): use localtime()
    > instead of
    > gmtime() when using FileLocalTimeToFileTime().



    Thank You, Nobu. So will wait for the Ruby 1.8.3-One-Click
    Installer... .

    Axel
     
    Axel Friedrich, Nov 1, 2005
    #3
  4. Axel Friedrich

    Curt Hibbs Guest

    On 10/31/05, Axel Friedrich <> wrote:
    > nobuyoshi nakada <> wrote in
    > news:2k.ad.ge.com:
    >
    > > I guess it has been fixed:
    > >
    > > Tue May 17 11:52:18 2005 NAKAMURA Usaku <>
    > >
    > > * win32/win32.c (unixtime_to_filetime): use localtime()
    > > instead of
    > > gmtime() when using FileLocalTimeToFileTime().

    >
    >
    > Thank You, Nobu. So will wait for the Ruby 1.8.3-One-Click
    > Installer... .


    There's not going to be a 1.8.3 One-Click installer, because 1.8.4 is
    going to be out in a couple months, and we are concentrating our time
    on that.

    Curt
     
    Curt Hibbs, Nov 1, 2005
    #4

  5. > There's not going to be a 1.8.3 One-Click installer, because
    > 1.8.4 is going to be out in a couple months, and we are
    > concentrating our time on that.
    >
    > Curt


    Thank You for this info. I like the One-Click Installer very much; it
    makes the things so much easier... .

    Axel
     
    Axel Friedrich, Nov 2, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin Bless
    Replies:
    1
    Views:
    2,886
    Matt Gerrans
    Dec 9, 2004
  2. mike
    Replies:
    2
    Views:
    246
  3. Axel Friedrich

    utime: still with bug?

    Axel Friedrich, Mar 1, 2006, in forum: Ruby
    Replies:
    2
    Views:
    115
    Axel Friedrich
    Mar 2, 2006
  4. Matt Scilipoti
    Replies:
    2
    Views:
    203
    Matt Scilipoti
    Jun 6, 2007
  5. Matt Spendlove

    utime a dir and convert Date to Time

    Matt Spendlove, Jan 15, 2008, in forum: Ruby
    Replies:
    3
    Views:
    113
    Siep Korteling
    Jan 15, 2008
Loading...

Share This Page