3件ヒット
[1-3件を表示]
(0.106秒)
クラス
-
File
:: Stat (1) - Pathname (1)
-
Thread
:: Mutex (1)
検索結果
先頭3件
-
Thread
:: Mutex # sleep(timeout = nil) -> Integer (54679.0) -
与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
@param timeout スリープする秒数を指定します。省略するとスリープし続けます。
@return スリープしていた秒数を返します。
@raise ThreadError 自身がカレントスレッドによってロックされていない場合に発生します。
[注意] 2.0 以降ではスリープ中でも、シグナルを受信した場合などに実行が再
開(spurious wakeup)される場合がある点に注意してください。
//emlist[例][ruby]{
m = Mutex.new
th = Thread.new do
... -
File
:: Stat # birthtime -> Time (18661.0) -
作成された時刻を返します。
作成された時刻を返します。
@raise 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... -
Pathname
# ctime -> Time (18625.0) -
File.ctime(self.to_s) を渡したものと同じです。
File.ctime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require 'pathname'
IO.write("testfile", "test")
pathname = Pathname("testfile")
pathname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
pathname.chmod(0755)
pathname.ctime # => 2019-01-14 00:39:52 +0900
//}
@see File.ctime