るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.027秒)
トップページ > クエリ:time[x] > ライブラリ:ビルトイン[x] > バージョン:2.4.0[x] > クエリ:new[x] > クラス:File[x]

別のキーワード

  1. time iso8601
  2. time rfc2822
  3. time httpdate
  4. time parse
  5. time strptime

キーワード

検索結果

File.utime(atime, mtime, *filename) -> Integer (19036.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#birthtime -> Time (18679.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...