зеркало из https://github.com/github/ruby.git
* file.c (rb_stat_s_utime): fixed a commit miss for the platforms
where utimes() does not exist. * lib/fileutils.rb (touch): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
35fadee53d
Коммит
9b7ecc68a9
|
@ -1,3 +1,10 @@
|
||||||
|
Sun Mar 4 23:38:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (rb_stat_s_utime): fixed a commit miss for the platforms
|
||||||
|
where utimes() does not exist.
|
||||||
|
|
||||||
|
* lib/fileutils.rb (touch): ditto.
|
||||||
|
|
||||||
Sun Mar 4 14:46:56 2007 WATANABE Hirofumi <eban@ruby-lang.org>
|
Sun Mar 4 14:46:56 2007 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* util.c (push_element): should return a int value.
|
* util.c (push_element): should return a int value.
|
||||||
|
|
13
file.c
13
file.c
|
@ -2031,12 +2031,15 @@ rb_file_s_utime(int argc, VALUE *argv)
|
||||||
|
|
||||||
rb_scan_args(argc, argv, "2*", &atime, &mtime, &rest);
|
rb_scan_args(argc, argv, "2*", &atime, &mtime, &rest);
|
||||||
|
|
||||||
tv = rb_time_timeval(atime);
|
if (!NIL_P(atime) || !NIL_P(mtime)) {
|
||||||
utbuf.actime = tv.tv_sec;
|
utp = &utbuf;
|
||||||
tv = rb_time_timeval(mtime);
|
tv = rb_time_timeval(atime);
|
||||||
utbuf.modtime = tv.tv_sec;
|
utp->actime = tv.tv_sec;
|
||||||
|
tv = rb_time_timeval(mtime);
|
||||||
|
utp->modtime = tv.tv_sec;
|
||||||
|
}
|
||||||
|
|
||||||
n = apply2files(utime_internal, rest, &utbuf);
|
n = apply2files(utime_internal, rest, utp);
|
||||||
return LONG2FIX(n);
|
return LONG2FIX(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1012,7 +1012,7 @@ module FileUtils
|
||||||
fu_check_options options, OPT_TABLE['touch']
|
fu_check_options options, OPT_TABLE['touch']
|
||||||
list = fu_list(list)
|
list = fu_list(list)
|
||||||
created = nocreate = options[:nocreate]
|
created = nocreate = options[:nocreate]
|
||||||
t = options[:mtime] || Time.now
|
t = options[:mtime]
|
||||||
if options[:verbose]
|
if options[:verbose]
|
||||||
fu_output_message "touch #{nocreate ? ' -c' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}"
|
fu_output_message "touch #{nocreate ? ' -c' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#define RUBY_VERSION "1.9.0"
|
#define RUBY_VERSION "1.9.0"
|
||||||
#define RUBY_RELEASE_DATE "2007-03-03"
|
#define RUBY_RELEASE_DATE "2007-03-04"
|
||||||
#define RUBY_VERSION_CODE 190
|
#define RUBY_VERSION_CODE 190
|
||||||
#define RUBY_RELEASE_CODE 20070303
|
#define RUBY_RELEASE_CODE 20070304
|
||||||
#define RUBY_PATCHLEVEL 0
|
#define RUBY_PATCHLEVEL 0
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
#define RUBY_VERSION_TEENY 0
|
#define RUBY_VERSION_TEENY 0
|
||||||
#define RUBY_RELEASE_YEAR 2007
|
#define RUBY_RELEASE_YEAR 2007
|
||||||
#define RUBY_RELEASE_MONTH 3
|
#define RUBY_RELEASE_MONTH 3
|
||||||
#define RUBY_RELEASE_DAY 3
|
#define RUBY_RELEASE_DAY 4
|
||||||
|
|
||||||
#ifdef RUBY_EXTERN
|
#ifdef RUBY_EXTERN
|
||||||
RUBY_EXTERN const char ruby_version[];
|
RUBY_EXTERN const char ruby_version[];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче