From: Nobuyoshi Nakada Date: 2006-10-12T14:36:25+09:00 Subject: Re: FileUtils.touch not consistent with system('touch') Hi, At Wed, 11 Oct 2006 19:08:36 +0900, Nobuyoshi Nakada wrote in [ruby-talk:219042]: > > Linux (and I assume this is Posix) allows a utime call with NULL if > > the file is writeable, rb_w32_utime() didn't support it. I'm not sure it should be LocalFileTime or not. Index: win32/win32.c =================================================================== RCS file: /pub/cvs/ruby/win32/win32.c,v retrieving revision 1.195 diff -U 2 -p -r1.195 win32.c --- win32/win32.c 12 Aug 2006 06:56:09 -0000 1.195 +++ win32/win32.c 12 Oct 2006 04:50:36 -0000 @@ -4118,9 +4118,15 @@ rb_w32_utime(const char *path, const str } - if (unixtime_to_filetime(times->actime, &atime)) { - return -1; + if (times) { + if (unixtime_to_filetime(times->actime, &atime)) { + return -1; + } + if (unixtime_to_filetime(times->modtime, &mtime)) { + return -1; + } } - if (unixtime_to_filetime(times->modtime, &mtime)) { - return -1; + else { + GetSystemTimeAsFileTime(&atime); + mtime = atime; } -- Nobu Nakada