るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.222秒)
トップページ > クラス:File[x] > クエリ:_builtin[x] > バージョン:2.4.0[x] > クエリ:mtime[x] > 種類:特異メソッド[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

File.mtime(filename) -> Time (78328.0)

最終更新時刻を返します。

...更新時刻を返します。

@param filename ファイル名を表す文字列か IO オブジェクトを指定します。

@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例][ruby]{
File
.mtime(__FILE__) # => 2017-12-03 03:16:22 +0900
//}...

File.utime(atime, mtime, *filename) -> Integer (24400.0)

ファイルの最終アクセス時刻と更新時刻を変更します。

...秒数を数値で指定します。

@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。

@param filename ファイル名を表す文字列を指定します。複数指定できます。

@return 変更したファイルの数を返します。

@ra...
...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.stat(filename) -> File::Stat (24025.0)

filename の情報を含む File::Stat オブジェクトを生成し て返します。

...
file
name の情報を含む File::Stat オブジェクトを生成し
て返します。

@param filename ファイル名を表す文字列を指定します。

@raise Errno::EXXX 情報の取得に失敗した場合に発生します。

//emlist[例][ruby]{
File
.stat("testfile").class # => Fi...
...le::Stat
File
.stat("testfile").mtime # => 2017-12-10 01:13:56 +0900
//}

@see IO#stat, File#lstat...