160件ヒット
[1-100件を表示]
(0.128秒)
種類
- インスタンスメソッド (87)
- 特異メソッド (51)
- クラス (22)
クラス
- File (83)
-
File
:: Stat (33) - Time (22)
検索結果
先頭5件
-
File
# mtime -> Time (32309.0) -
最終更新時刻を Time オブジェクトとして返します。
...ime オブジェクトとして返します。
@raise IOError 自身が close されている場合に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.mti......me } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#atime, File#ctime......me } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#atime, File#ctime, File#birthtime... -
File
. mtime(filename) -> Time (32309.0) -
最終更新時刻を返します。
...更新時刻を返します。
@param filename ファイル名を表す文字列か IO オブジェクトを指定します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例][ruby]{
File.mtime(__FILE__) # => 2017-12-03 03:16:22 +0900
//}... -
File
:: Stat # mtime -> Time (32309.0) -
最終更新時刻を返します。
...最終更新時刻を返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.mtime #=> Wed Sep 05 20:42:18 +0900 2007
//}
@see Time... -
Time
# gmtime -> self (23202.0) -
タイムゾーンを協定世界時に設定します。
...のメソッドを呼び出した後は時刻変換を協定世界時として行ないます。
Time#localtime, Time#gmtime の挙動はシステムの
localtime(3) の挙動に依存します。Time クラ
スでは時刻を起算時からの経過秒数として保持していますが、ある......す。システムを越えて 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... -
Time
# utc -> self (17002.0) -
タイムゾーンを協定世界時に設定します。
...のメソッドを呼び出した後は時刻変換を協定世界時として行ないます。
Time#localtime, Time#gmtime の挙動はシステムの
localtime(3) の挙動に依存します。Time クラ
スでは時刻を起算時からの経過秒数として保持していますが、ある......す。システムを越えて 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... -
File
. utime(atime , mtime , *filename) -> Integer (14433.0) -
ファイルの最終アクセス時刻と更新時刻を変更します。 シンボリックリンクに対しては File.lutime と違って、 シンボリックのリンク先を変更します。
...新時刻を変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。
@param filename ファイル名を表す文字列を......@raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例: Time を指定][ruby]{
atime = Time.new(2018, 1, 2, 3, 4, 5)
mtime = Time.new(2018, 2, 3, 4, 5, 6)
File.utime(atime, mtime, "testfile") # => 1
File.atime("testfile") # => 2018-01-02 03:04:05 +0900
File.......mtime("testfile") # => 2018-02-03 04:05:06 +0900
//}
//emlist[例: 経過秒数で指定][ruby]{
File.utime(1, 2, "testfile") # => 1
File.atime("testfile") # => 1970-01-01 09:00:01 +0900
File.mtime("testfile") # => 1970-01-01 09:00:02 +0900
//}......リックリンクに対しては File.lutime と違って、
シンボリックのリンク先を変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過......filename ファイル名を表す文字列を指定します。複数指定できます。
@return 変更したファイルの数を返します。
@raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例: Time を指定][ruby]{
atime = Time.new(2018, 1, 2, 3, 4, 5)
mtime......ime.new(2018, 2, 3, 4, 5, 6)
File.utime(atime, mtime, "testfile") # => 1
File.atime("testfile") # => 2018-01-02 03:04:05 +0900
File.mtime("testfile") # => 2018-02-03 04:05:06 +0900
//}
//emlist[例: 経過秒数で指定][ruby]{
File.utime(1, 2, "testfile") # => 1
Fi... -
File
. lutime(atime , mtime , *filename) -> Integer (14409.0) -
ファイルの最終アクセス時刻と更新時刻を変更します。 シンボリックリンクに対しては File.utime と違って、 シンボリックそのものを変更します。
...リックリンクに対しては File.utime と違って、
シンボリックそのものを変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒数......を数値で指定します。
@param filename ファイル名を表す文字列を指定します。複数指定できます。
@return 変更したファイルの数を返します。
@raise Errno::EXXX 変更に失敗した場合に発生します。
@see File.utime... -
File
# atime -> Time (14208.0) -
最終アクセス時刻を Time オブジェクトとして返します。
...ime オブジェクトとして返します。
@raise IOError 自身が close されている場合に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.ati......me } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#ctime, File#mtime......me } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#ctime, File#mtime, File#birthtime... -
File
# ctime -> Time (14208.0) -
状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。
...Time オブジェクトとして返します。状態の変更とは chmod などによるものです。
@raise IOError 自身が close されている場合に発生します。
@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.......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
# birthtime -> Time (14108.0) -
作成された時刻を Time オブジェクトとして返します。
...た時刻を Time オブジェクトとして返します。
@raise IOError 自身が close されている場合に発生します。
@raise Errno::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...