Project

General

Profile

Actions

Feature #9647

closed

File::Stat#birthtimeの追加

Added by naruse (Yui NARUSE) about 10 years ago. Updated almost 10 years ago.

Status:
Closed
Target version:
-
[ruby-dev:48048]

Description

File::Stat#birthtimeを追加しませんか。

以下の様なシステムの stat(2) には st_birthtimespec があり、
(ctime = change time ではなく) ファイルを作成した日時を得ることができます。
http://netbsd.gw.com/cgi-bin/man-cgi?stat+2+NetBSD-current
http://www.freebsd.org/cgi/man.cgi?query=stat&sektion=2&apropos=0&manpath=FreeBSD+10.0-RELEASE
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/stat.2.html

また、Windowsはbirthtimeがあるがctimeがないという環境ですので、birthtimeはctimeを返します。
http://msdn.microsoft.com/ja-jp/library/ms350241(v=vs.71).aspx

今回のパッチではLinuxやOpenBSDなど、struct statにbirthtimeがない環境では、
Windows同様ctimeを返すようにしています。
(が、意味が違うからWindows以外ではNotImpErrorの方がいいかも)

https://github.com/nurse/ruby/compare/ruby:trunk...birthtime


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #9857: Pathname#birthtimeClosedakr (Akira Tanaka)05/22/2014Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0