33件ヒット
[1-33件を表示]
(0.124秒)
ライブラリ
- ビルトイン (33)
クラス
-
File
:: Stat (22) - IO (11)
検索結果
-
File
:: Stat # atime -> Time (21114.0) -
最終アクセス時刻を返します。
...最終アクセス時刻を返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.atime.to_a #=> [45, 5, 21, 5, 9, 2007, 3, 248, false, "\223\214\213\236 (\225W\217\200\216\236) "]
//}
@see Time... -
IO
# stat -> File :: Stat (18237.0) -
ファイルのステータスを含む File::Stat オブジェクトを生成して 返します。
...ファイルのステータスを含む File::Stat オブジェクトを生成して
返します。
@raise Errno::EXXX ステータスの読み込みに失敗した場合に発生します。
@raise IOError 既に close されていた場合に発生します。
//emlist[例][ruby]{
IO.write("......testfile", "This is line one\nThis is line two\n")
File.open("testfile") do |f|
s = f.stat
"%o" % s.mode # => "100644"
s.blksize # => 4096
s.atime # => 2018-03-01 23:19:59 +0900
end
//}
@see File#lstat, File.stat, File.lstat... -
File
:: Stat # birthtime -> Time (3031.0) -
作成された時刻を返します。
...tfile")
sleep 10
File.read("testfile")
File.stat("testfile").birthtime #=> 2014-02-24 11:19:17 +0900
File.stat("testfile").mtime #=> 2014-02-24 11:19:27 +0900
File.stat("testfile").ctime #=> 2014-02-24 11:19:37 +0900
File.stat("testfile").atime #=> 2014-02-24 11:19:47 +0900
//}...