1196件ヒット
[101-200件を表示]
(0.148秒)
ライブラリ
- ビルトイン (968)
- etc (12)
- expect (24)
-
io
/ console (96) -
io
/ nonblock (36) -
io
/ wait (60)
キーワード
- << (12)
- advise (12)
- autoclose= (12)
- autoclose? (12)
- binmode (12)
- binmode? (12)
- bytes (7)
- chars (7)
- clone (12)
- close (12)
-
close
_ on _ exec= (12) -
close
_ on _ exec? (12) -
close
_ read (12) -
close
_ write (12) - closed? (12)
- codepoints (7)
- cooked! (12)
- dup (12)
- each (69)
-
each
_ byte (12) -
each
_ char (12) -
each
_ codepoint (12) -
each
_ line (72) - echo= (12)
- echo? (12)
- eof (12)
- eof? (12)
- expect (24)
-
external
_ encoding (12) - fcntl (12)
- fileno (12)
- flush (12)
- getbyte (12)
- getc (12)
- gets (36)
- iflush (12)
-
internal
_ encoding (12) - ioctl (12)
- ioflush (12)
- isatty (12)
- lineno (12)
- lineno= (12)
- lines (42)
- nonblock (12)
- nonblock= (12)
- nonblock? (12)
- oflush (12)
- path (3)
- pathconf (12)
- pid (12)
- pread (8)
- print (12)
- printf (12)
- puts (12)
- raw (12)
- raw! (12)
- read (12)
-
read
_ nonblock (12) - readline (36)
- readlines (36)
- readpartial (12)
- ready? (12)
- reopen (36)
-
set
_ encoding (36) -
set
_ encoding _ by _ bom (6) - stat (12)
- sync (12)
- sysread (12)
- tell (12)
-
to
_ i (12) -
to
_ io (12) -
to
_ path (3) - tty? (12)
- ungetbyte (12)
- ungetc (12)
- wait (12)
-
wait
_ readable (12) -
wait
_ writable (24) -
write
_ nonblock (12)
検索結果
先頭5件
-
IO
# autoclose? -> bool (6102.0) -
auto-close フラグを返します。
...auto-close フラグを返します。
//emlist[例][ruby]{
IO.open(IO.sysopen("testfile")) do |io|
io.autoclose? # => true
io.autoclose = false
io.autoclose? # => false
end
//}
@see IO#autoclose=... -
IO
# clone -> IO (6102.0) -
レシーバと同じ IO を参照する新しい IO オブジェクトを返します。 参照しているファイル記述子は dup(2) されます。
...シーバと同じ IO を参照する新しい IO オブジェクトを返します。
参照しているファイル記述子は dup(2) されます。
clone の際に self は一旦 IO#flush されます。
フリーズした IO の clone は同様にフリーズされた IO を返しますが、......しいフリーズされていない IO を返します。
@raise IOError 既に close されていた場合に発生します。
//emlist[例][ruby]{
clone_io = nil
IO.write("testfile", "test")
File.open("testfile") do |io|
clone_io = io.clone
end
clone_io.read # => "test"
clone_io.close
//}... -
IO
# close -> nil (6102.0) -
入出力ポートをクローズします。
...例外 IOError が発生しま
す。ガーベージコレクトの際にはクローズされていない IO ポートはクロー
ズされます。
self がパイプでプロセスにつながっていれば、そのプロセスの終
了を待ち合わせます。
@raise Errno::EXXX close に......raise IOError 既に close されていた場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "test")
f = File.open("testfile")
f.read # => "test"
f.close
# f.read # => IOError (すでに close しているので read できない)
//}
@see IO#closed?, IO#close_read, IO#close_w......うと例外 IOError が発生しま
す。ガーベージコレクトの際にはクローズされていない IO ポートはクロー
ズされます。
self がパイプでプロセスにつながっていれば、そのプロセスの終
了を待ち合わせます。
既に close されて......se Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "test")
f = File.open("testfile")
f.read # => "test"
f.close
# f.read # => IOError (すでに close しているので read できない)
//}
@see IO#closed?, IO#close_read, IO#close_write... -
IO
# close _ on _ exec=(bool) (6102.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
f.closed? #=> false
@see IO#close_on_exec?... -
IO
# close _ on _ exec? -> bool (6102.0) -
自身に close-on-exec フラグが設定されていた場合 true を返します。 そうでない場合に false を返します。
...自身に close-on-exec フラグが設定されていた場合 true を返します。
そうでない場合に false を返します。
f = open("/dev/null")
f.close_on_exec? #=> true
f.close_on_exec = false
f.close_on_exec? #=> false
f.close_on_exec......= true
f.close_on_exec? #=> true
@see IO#close_on_exec=... -
IO
# close _ read -> nil (6102.0) -
読み込み用の IO を close します。主にパイプや読み書き両用に作成し た IO オブジェクトで使用します。
... IO を close します。主にパイプや読み書き両用に作成し
た IO オブジェクトで使用します。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[......例][ruby]{
IO.popen("/bin/sh","r+") do |f|
f.close_read
# f.readlines # => IOError: not opened for reading
end
//}
@see IO#close, IO#closed?, IO#close_write......読み込み用の IO を close します。主にパイプや読み書き両用に作成し
た IO オブジェクトで使用します。
既に close されていた場合には単に無視されます。
@raise IOError 自身が読み込み用にオープンされていなければ発生し......ます。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
IO.popen("/bin/sh","r+") do |f|
f.close_read
# f.readlines # => IOError: not opened for reading
end
//}
@see IO#close, IO#closed?, IO#close_write... -
IO
# close _ write -> nil (6102.0) -
書き込み用の IO を close します。
... IO を close します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
f = IO.popen("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOEr......ror: not opened for writing
end
//}
@see IO#close, IO#closed?, IO#close_read......の IO を close します。
既に close されていた場合には単に無視されます。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
f = IO.popen......("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOError: not opened for writing
end
//}
@see IO#close, IO#closed?, IO#close_read... -
IO
# closed? -> bool (6102.0) -
self が完全に(読み込み用と書き込み用の両方が)クローズされている場合に true を返します。 そうでない場合は false を返します。
...self が完全に(読み込み用と書き込み用の両方が)クローズされている場合に true を返します。
そうでない場合は false を返します。
//emlist[例][ruby]{
IO.write("testfile", "test")
f = File.new("testfile")
f.close # => nil
f.closed? # => tr......ue
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... -
IO
# external _ encoding -> Encoding | nil (6102.0) -
IO の外部エンコーディングを返します。 外部エンコーディングが指定されていない場合は nil を返します。 ただし読み込み専用モードの場合は Encoding.default_external になります。
...
IO の外部エンコーディングを返します。
外部エンコーディングが指定されていない場合は nil を返します。
ただし読み込み専用モードの場合は Encoding.default_external になります。
//emlist[例][ruby]{
IO.write("testfile", "abcde")
File.ope......n("testfile") { |f| p f.external_encoding } # => #<Encoding:UTF-8>
//}...