Project

General

Profile

Feature #9857 » pathname-birthtime.patch

znz (Kazuhiro NISHIYAMA), 05/27/2014 02:28 PM

View differences:

ext/pathname/pathname.c
/*
* call-seq:
* pathname.birthtime -> time
*
* Returns the birth time for the file.
* If the platform doesn't have birthtime, returns <i>ctime</i>.
*
* See File.birthtime.
*/
static VALUE
path_birthtime(VALUE self)
{
return rb_funcall(rb_cFile, rb_intern("birthtime"), 1, get_strpath(self));
}
/*
* call-seq:
* pathname.ctime -> time
*
* Returns the last change time, using directory information, not the file itself.
......
*
* These methods are a facade for File:
* - #atime
* - #birthtime
* - #ctime
* - #mtime
* - #chmod(mode)
......
rb_define_method(rb_cPathname, "binwrite", path_binwrite, -1);
rb_define_method(rb_cPathname, "sysopen", path_sysopen, -1);
rb_define_method(rb_cPathname, "atime", path_atime, 0);
rb_define_method(rb_cPathname, "birthtime", path_birthtime, 0);
rb_define_method(rb_cPathname, "ctime", path_ctime, 0);
rb_define_method(rb_cPathname, "mtime", path_mtime, 0);
rb_define_method(rb_cPathname, "chmod", path_chmod, 1);
(1-1/2)