Project

General

Profile

Feature #9857 ยป pathname-birthtime.patch

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

View differences:

ext/pathname/pathname.c
442 442

  
443 443
/*
444 444
 * call-seq:
445
 *   pathname.birthtime	-> time
446
 *
447
 * Returns the birth time for the file.
448
 * If the platform doesn't have birthtime, returns <i>ctime</i>.
449
 *
450
 * See File.birthtime.
451
 */
452
static VALUE
453
path_birthtime(VALUE self)
454
{
455
    return rb_funcall(rb_cFile, rb_intern("birthtime"), 1, get_strpath(self));
456
}
457

  
458
/*
459
 * call-seq:
445 460
 *   pathname.ctime	-> time
446 461
 *
447 462
 * Returns the last change time, using directory information, not the file itself.
......
1288 1303
 *
1289 1304
 * These methods are a facade for File:
1290 1305
 * - #atime
1306
 * - #birthtime
1291 1307
 * - #ctime
1292 1308
 * - #mtime
1293 1309
 * - #chmod(mode)
......
1380 1396
    rb_define_method(rb_cPathname, "binwrite", path_binwrite, -1);
1381 1397
    rb_define_method(rb_cPathname, "sysopen", path_sysopen, -1);
1382 1398
    rb_define_method(rb_cPathname, "atime", path_atime, 0);
1399
    rb_define_method(rb_cPathname, "birthtime", path_birthtime, 0);
1383 1400
    rb_define_method(rb_cPathname, "ctime", path_ctime, 0);
1384 1401
    rb_define_method(rb_cPathname, "mtime", path_mtime, 0);
1385 1402
    rb_define_method(rb_cPathname, "chmod", path_chmod, 1);