7件ヒット
[1-7件を表示]
(0.075秒)
別のキーワード
クラス
-
ARGF
. class (1) - CSV (1)
- IO (2)
- StringIO (1)
-
Zlib
:: GzipFile (2)
キーワード
-
close
_ on _ exec= (1) - closed? (5)
-
to
_ io (1)
検索結果
先頭5件
-
IO
# closed? -> bool (117451.0) -
self が完全に(読み込み用と書き込み用の両方が)クローズされている場合に true を返します。 そうでない場合は false を返します。
self が完全に(読み込み用と書き込み用の両方が)クローズされている場合に true を返します。
そうでない場合は false を返します。
//emlist[例][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 # =>... -
StringIO
# closed? -> bool (63361.0) -
自身が既に close されていた場合に true を返します。そうでない場合は、false を返します。
自身が既に close されていた場合に true を返します。そうでない場合は、false を返します。
//emlist[例][ruby]{
require "stringio"
sio = StringIO.open("hoge")
p sio.closed? # => false
sio.close_read
p sio.closed? # => false
sio.close_write
p sio.closed? # => true
//} -
IO
# close _ on _ exec=(bool) (63040.0) -
自身に close-on-exec フラグを設定します。
自身に close-on-exec フラグを設定します。
このフラグをセットすると exec(2) 時にそのファイルデスクリプタを
close します。
@see fcntl(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
... -
Zlib
:: GzipFile # closed? -> bool (54415.0) -
IO クラスの同名メソッドと同じ。
IO クラスの同名メソッドと同じ。
@see IO#to_io, IO#closed? -
CSV
# closed? -> bool (54373.0) -
IO#closed? に委譲します。
IO#closed? に委譲します。
@see IO#closed? -
ARGF
. class # closed? -> bool (54361.0) -
現在開いている処理対象のファイルがARGFがcloseされていればtrueを返します。
現在開いている処理対象のファイルがARGFがcloseされていればtrueを返します。
例:
# $ echo "foo" > foo
# $ echo "bar" > bar
# $ ruby argf.rb foo bar
ARGF.filename # => "foo"
ARGF.close
# 複数のファイルを開いているので1度のARGF.closeではまた全てのファイルを閉じていないのでfalseになる
ARGF.closed? # => false
ARGF.filename # => "bar"
ARGF.close
# 2つ... -
Zlib
:: GzipFile # to _ io -> IO (18715.0) -
IO クラスの同名メソッドと同じ。
IO クラスの同名メソッドと同じ。
@see IO#to_io, IO#closed?