るりまサーチ

最速Rubyリファレンスマニュアル検索!
183件ヒット [1-100件を表示] (0.206秒)
トップページ > クエリ:-[x] > クエリ:E[x] > クエリ:ruby[x] > クエリ:mtime[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. matrix rank_e
  5. open3 capture2e

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

File#mtime -> Time (24425.0)

最終更新時刻を Time オブジェクトとして返します。

...e オブジェクトとして返します。

@raise IOError 自身が close されている場合に発生します。

@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...
...} # => 2017-12-21 22:58:17 +0900
//}

@see File#lstat, File#atime, File#ctime, File#birthtime...

File::Stat#mtime -> Time (24413.0)

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

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

//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.mtime #=> Wed Sep 05 20:42:18 +0900 2007
//}

@see Time...

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

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

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

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

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

//emlist[例][ruby]{
File.mtime(__FILE__) # => 2017-12-03 03:16:22 +0900
//}...
...更新時刻を返します。

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

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

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

Time#gmtime -> self (12330.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-01-01 11:15:01 UTC
p...
...t.gmt? # => true
//}...

NEWS for Ruby 2.5.0 (9255.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...NEWS for Ruby 2.5.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...トは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 2.4.0 以降の変更

=== 言語仕様の変更

* トップレベルの定数参照を削除しました 11547
* do/end ブロック内部で rescue/else/ensure を書けるようになりまし...
...IOError を発生させます
13568
* File.stat, File.exist? など rb_stat() を使用しているメソッドではGVLを解放するようになりました
13941
* File.rename GVL を解放するようになりました 13951
* File::Stat#atime, File::Stat#mtime, File::S...

絞り込み条件を変える

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

ファイルの最終アクセス時刻と更新時刻を変更します。 シンボリックリンクに対しては File.lutime と違って、 シンボリックのリンク先を変更します。

...時刻を変更します。

@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。

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

@param filename ファイル名を表す文字列を指...
...@return 変更したファイルの数を返します。

@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("tes...
...file") # => 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")...
...ックリンクに対しては File.lutime と違って、
シンボリックのリンク先を変更します。

@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。

@param mtime 更新時刻を Time か、起算時からの経過秒...
...ilename ファイル名を表す文字列を指定します。複数指定できます。

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

@raise Errno::EXXX 変更に失敗した場合に発生します。

//emlist[例: Time を指定][ruby]{
atime = Time.new(2018, 1, 2, 3, 4, 5)
mtime
=...
...e.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...

File::Stat#birthtime -> Time (6360.0)

作成された時刻を返します。

...aise NotImplementedError Windows のような birthtime のない環境で発生します。

//emlist[][ruby]{
File.write("testfile", "foo")
sleep 10
File.write("testfile", "bar")
sleep 10
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-24 11:19:47 +0900
//}...

File#atime -> Time (6324.0)

最終アクセス時刻を Time オブジェクトとして返します。

...e オブジェクトとして返します。

@raise IOError 自身が close されている場合に発生します。

@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...
...} # => 2017-12-21 22:58:17 +0900
//}

@see File#lstat, File#ctime, File#mtime, File#birthtime...

File#ctime -> Time (6324.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::Stat.new(path) -> File::Stat (6236.0)

path に関する File::Stat オブジェクトを生成して返します。 File.stat と同じです。

...le::Stat オブジェクトを生成して返します。
File.stat と同じです。

@param path ファイルのパスを指定します。

@raise Errno::ENOENT pathに該当するファイルが存在しない場合発生します。

//emlist[][ruby]{
p $:[0]
#=> 例
# "C:/Program Files/ruby-1...
....8/lib/ruby/site_ruby/1.8"
p File::Stat.new($:[0])
#=> 例
#<File::Stat dev=0x2, ino=0, mode=040755, nlink=1, uid=0, gid=0, rdev=0x2, size=0, blksize=nil, blocks=nil, atime=Sun Sep 02 14:15:20 +0900 2007, mtime=Tue Apr 24 23:03:44 +0900 2007, ctime=Tue Apr 24 23:03:37 +0900 2007>
//}...

絞り込み条件を変える

<< 1 2 > >>