[ruby-trunk - Feature #9647] File::Stat#birthtimeの追加

Issue #9647 has been updated by Usaku NAKAMURA.

Yui NARUSE wrote:

Windowsの方はなるほど…なので、とりあえずWindowsもNotImpErrorにしてうささんに実装してもらいますかね(ゎ

いやあの、Windowsはそれでいいので付けといてください(笑)
今のctimeのことを考えると、多少の意味の違いなんかどうでもいい感があります。


Feature #9647: File::Stat#birthtimeの追加

  • Author: Yui NARUSE
  • Status: Assigned
  • Priority: Normal
  • Assignee: Yukihiro M.
  • Category: core
  • Target version:

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