87件ヒット
[1-87件を表示]
(0.034秒)
クラス
- File (43)
-
File
:: Stat (22) - Time (22)
検索結果
先頭5件
-
File
# mtime -> Time (18110.0) -
最終更新時刻を Time オブジェクトとして返します。
...ている場合に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#atime, File#ctime......に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#atime, File#ctime, File#birthtime... -
File
:: Stat # mtime -> Time (18110.0) -
最終更新時刻を返します。
...最終更新時刻を返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.mtime #=> Wed Sep 05 20:42:18 +0900 2007
//}
@see Time... -
Time
# gmtime -> self (6103.0) -
タイムゾーンを協定世界時に設定します。
...に設定します。
このメソッドを呼び出した後は時刻変換を協定世界時として行ないます。
Time#localtime, Time#gmtime の挙動はシステムの
localtime(3) の挙動に依存します。Time クラ
スでは時刻を起算時からの経過秒数として保持......合には注意する必要があります。
//emlist[][ruby]{
p t = Time.local(2000,1,1,20,15,1) # => 2000-01-01 20:15:01 +0900
p t.gmt? # => false
p t.gmtime # => 2000-01-01 11:15:01 UTC
p t.gmt? # => true
//}... -
Time
# utc -> self (3003.0) -
タイムゾーンを協定世界時に設定します。
...に設定します。
このメソッドを呼び出した後は時刻変換を協定世界時として行ないます。
Time#localtime, Time#gmtime の挙動はシステムの
localtime(3) の挙動に依存します。Time クラ
スでは時刻を起算時からの経過秒数として保持......合には注意する必要があります。
//emlist[][ruby]{
p t = Time.local(2000,1,1,20,15,1) # => 2000-01-01 20:15:01 +0900
p t.gmt? # => false
p t.gmtime # => 2000-01-01 11:15:01 UTC
p t.gmt? # => true
//}... -
File
# atime -> Time (9.0) -
最終アクセス時刻を Time オブジェクトとして返します。
...れている場合に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.atime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#ctime, File#mtime......に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.atime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#ctime, File#mtime, File#birthtime... -
File
# birthtime -> Time (9.0) -
作成された時刻を Time オブジェクトとして返します。
...::EXXX ファイルの時刻の取得に失敗した場合に発生します。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
File.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003
@see File#lstat, File#atime, File#ctime, File#mtime... -
File
# ctime -> Time (9.0) -
状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。
...れている場合に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#atime, File#mtime......に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#atime, File#mtime, File#birthtime... -
File
:: Stat # birthtime -> Time (9.0) -
作成された時刻を返します。
...0
File.chmod(0644, "testfile")
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-...