instance method
File#birthtime
() -> ::Time
file.birthtime → time
file.c
View on GitHub ↗
static VALUE
rb_file_birthtime(VALUE obj)
{
rb_io_t *fptr;
rb_io_stat_data st;
GetOpenFile(obj, fptr);
if (fstatx_without_gvl(fptr, &st, STATX_BTIME) == -1) {
rb_sys_fail_path(fptr->pathv);
}
return statx_birthtime(&st);
}
Returns the birth time for file.
Example
File.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003
If the platform doesn’t have birthtime, raises NotImplementedError.