73件ヒット
[1-73件を表示]
(0.068秒)
種類
- インスタンスメソッド (62)
- 変数 (11)
クラス
-
ARGF
. class (11) - IO (22)
-
Thread
:: Queue (9) -
Thread
:: SizedQueue (9) - ThreadGroup (11)
モジュール
- Kernel (11)
キーワード
-
$ stdin (11) - close (9)
-
close
_ on _ exec= (11) - enclosed? (11)
検索結果
先頭5件
-
IO
# closed? -> bool (26121.0) -
self が完全に(読み込み用と書き込み用の両方が)クローズされている場合に true を返します。 そうでない場合は false を返します。
...例][ruby]{
IO.write("testfile", "test")
f = File.new("testfile")
f.close # => nil
f.closed? # => true
f = IO.popen("/bin/sh","r+")
f.close_write # => nil
f.closed? # => false
f.close_read # => nil
f.closed? # => true
//}
@see IO#close, IO#close_read, IO#close_write... -
ARGF
. class # closed? -> bool (26115.0) -
現在開いている処理対象のファイルがARGFがcloseされていればtrueを返します。
...ルを閉じていないのでfalseになる
ARGF.closed? # => false
ARGF.filename # => "bar"
ARGF.close
# 2つのファイルを開いていたので2度目のARGF.closeで全てのファイルを閉じたためtrueになる
ARGF.closed? # => true
@see IO#closed?, ARGF.class#close... -
Thread
:: Queue # closed? -> bool (26115.0) -
キューが close されている時に true を返します。
...キューが close されている時に true を返します。
//emlist[例][ruby]{
q = Queue.new
[:resource1, :resource2, :resource3, nil].each { |r| q.push(r) }
q.closed? # => false
q.close
q.closed? # => true
//}... -
ThreadGroup
# enclosed? -> bool (14102.0) -
自身が enclose されているなら true を返します。そうでないなら false を返します。デフォルトは false です。
...きませんが、enclosed? は false を返します。
thg = ThreadGroup.new
p thg.enclosed? # => false
thg.enclose
p thg.enclosed? # => true
thg = ThreadGroup.new
p thg.enclosed? # => false
thg.freeze
p thg.enclosed? # => false
@s... -
Thread
:: SizedQueue # close -> self (8014.0) -
キューを close します。詳しくは Thread::Queue#close を参照してください。
...追加するスレッドを待機している場合は
ClosedQueueError が発生して中断されます。
//emlist[例][ruby]{
q = SizedQueue.new(4)
[:resource1, :resource2, :resource3, nil].each { |r| q.push(r) }
q.closed? # => false
q.close
q.closed? # => true
//}
@see Thread::Queue#close... -
IO
# close _ on _ exec=(bool) (8008.0) -
自身に close-on-exec フラグを設定します。
...2)
@param bool 自身の close-on-exec フラグを true か false で指定します。
f = open("/dev/null")
f.close_on_exec = true
system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory
f.closed? #=> false
@see IO#close_on_exec?... -
Kernel
$ $ stdin -> object (8008.0) -
標準入力です。
...ません。
gets, readline, readlines, getc, readchar, tell, seek,
pos=, rewind, fileno, to_io, eof, each_line, each_byte,
binmode, closed?
//emlist[例][ruby]{
$stdin = Object.new
def $stdin.gets
"foo"
end
p gets() # => "foo"
//}
自プロセスだけでなく、子プロセス...