種類
- インスタンスメソッド (1097)
- 特異メソッド (473)
- 定数 (55)
キーワード
- << (11)
-
SEEK
_ CUR (11) -
SEEK
_ DATA (11) -
SEEK
_ END (11) -
SEEK
_ HOLE (11) -
SEEK
_ SET (11) - advise (11)
- autoclose= (11)
- autoclose? (11)
- binmode (11)
- binmode? (11)
- binread (11)
- binwrite (11)
- bytes (14)
- chars (14)
- clone (11)
- close (11)
-
close
_ on _ exec= (11) -
close
_ on _ exec? (11) -
close
_ read (11) -
close
_ write (11) - closed? (11)
- codepoints (14)
-
copy
_ stream (22) - dup (11)
- each (66)
-
each
_ byte (22) -
each
_ char (22) -
each
_ codepoint (22) -
each
_ line (66) - eof (11)
- eof? (11)
-
external
_ encoding (11) - fcntl (11)
- fdatasync (11)
- fileno (11)
- flush (11)
-
for
_ fd (11) - foreach (22)
- fsync (11)
- getbyte (11)
- getc (11)
- gets (33)
-
internal
_ encoding (11) - ioctl (11)
- isatty (11)
- lineno (11)
- lineno= (11)
- lines (42)
- new (11)
- open (22)
- path (2)
- pid (11)
- pipe (88)
- popen (154)
- pos (11)
- pos= (11)
- pread (7)
- print (11)
- printf (11)
- putc (11)
- puts (11)
- pwrite (7)
- read (44)
-
read
_ nonblock (11) - readbyte (11)
- readchar (11)
- readline (33)
- readlines (66)
- readpartial (11)
- reopen (33)
- rewind (11)
- seek (11)
- select (11)
-
set
_ encoding (33) -
set
_ encoding _ by _ bom (5) - stat (11)
- sync (11)
- sync= (11)
- sysopen (11)
- sysread (11)
- sysseek (11)
- syswrite (11)
- tell (11)
-
to
_ i (11) -
to
_ io (11) -
to
_ path (2) -
try
_ convert (11) - tty? (11)
- ungetbyte (11)
- ungetc (11)
- write (33)
-
write
_ nonblock (11)
検索結果
先頭5件
- IO
. popen(env = {} , [cmdname , *args , execopt={}] , mode = "r" , opt={}) {|f| . . . } -> object - IO
. popen(env = {} , command , mode = "r" , opt={}) -> IO - IO
. popen(env = {} , command , mode = "r" , opt={}) {|f| . . . } -> object - IO
. popen(env , "-" , mode = "r" , opt={}) -> IO - IO
. popen(env , "-" , mode = "r" , opt={}) {|io| . . . } -> object
-
IO
. popen(env = {} , [cmdname , *args , execopt={}] , mode = "r" , opt={}) {|f| . . . } -> object (3.0) -
サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
...出力
との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
p io = IO.popen("cat", "r+") # => #<IO:fd 4>
io.puts "foo"
io.close_write
p io.gets # => "foo\n"
サブプロセスを指定する方法は2......生成した IO オブジェクトを引数にブ
ロックを実行し、ブロックの実行結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
#......ョンや、パイプ IO オブジェクトの属性(エンコーディングや
読み書き能力)を指定することができます。
プロセス起動のためのオプションは Kernel.#spawn と、
パイプオブジェクトの属性の指定のオプションは IO.new と共通です... -
IO
. popen(env = {} , command , mode = "r" , opt={}) -> IO (3.0) -
サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
...出力
との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
p io = IO.popen("cat", "r+") # => #<IO:fd 4>
io.puts "foo"
io.close_write
p io.gets # => "foo\n"
サブプロセスを指定する方法は2......生成した IO オブジェクトを引数にブ
ロックを実行し、ブロックの実行結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
#......ョンや、パイプ IO オブジェクトの属性(エンコーディングや
読み書き能力)を指定することができます。
プロセス起動のためのオプションは Kernel.#spawn と、
パイプオブジェクトの属性の指定のオプションは IO.new と共通です... -
IO
. popen(env = {} , command , mode = "r" , opt={}) {|f| . . . } -> object (3.0) -
サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
...出力
との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
p io = IO.popen("cat", "r+") # => #<IO:fd 4>
io.puts "foo"
io.close_write
p io.gets # => "foo\n"
サブプロセスを指定する方法は2......生成した IO オブジェクトを引数にブ
ロックを実行し、ブロックの実行結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
#......ョンや、パイプ IO オブジェクトの属性(エンコーディングや
読み書き能力)を指定することができます。
プロセス起動のためのオプションは Kernel.#spawn と、
パイプオブジェクトの属性の指定のオプションは IO.new と共通です... -
IO
. popen(env , "-" , mode = "r" , opt={}) -> IO (3.0) -
第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。
...ンを確立します。
親プロセスでは IO オブジェクトを返し、子プロセスでは
nil を返します。
io = IO.popen("-", "r+")
if io # parent
io.puts "foo"
p io.gets # => "child output: foo\n"
io.close
else # child
s = gets
print...... IO オブジェクトを引数に
ブロックを実行し、その結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
子プロセスでは nil を引数にブロックを実行し終了します。
p IO.popen("-", "r+") {|io|......if io # parent
io.puts "foo"
io.gets
else # child
s = gets
puts "child output: " + s
end
}
# => "child output: foo\n"
opt ではエンコーディングの設定やプロセス起動のためのオプションが指定できます。
IO.new や Kernel.#spa... -
IO
. popen(env , "-" , mode = "r" , opt={}) {|io| . . . } -> object (3.0) -
第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。
...ンを確立します。
親プロセスでは IO オブジェクトを返し、子プロセスでは
nil を返します。
io = IO.popen("-", "r+")
if io # parent
io.puts "foo"
p io.gets # => "child output: foo\n"
io.close
else # child
s = gets
print...... IO オブジェクトを引数に
ブロックを実行し、その結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
子プロセスでは nil を引数にブロックを実行し終了します。
p IO.popen("-", "r+") {|io|......if io # parent
io.puts "foo"
io.gets
else # child
s = gets
puts "child output: " + s
end
}
# => "child output: foo\n"
opt ではエンコーディングの設定やプロセス起動のためのオプションが指定できます。
IO.new や Kernel.#spa... -
IO
. read(path , **opt) -> String | nil (3.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...場合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合......e
IO.open のモードを指定します。
"r" で始まる文字列である必要があります。
: :open_args
IO.open に渡される引数を配列で指定します。
これらの他、 :external_encoding など
IO.open のオプション引数が指定できます。
@see IO.......binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
IO
. read(path , length = nil , **opt) -> String | nil (3.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...場合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合......e
IO.open のモードを指定します。
"r" で始まる文字列である必要があります。
: :open_args
IO.open に渡される引数を配列で指定します。
これらの他、 :external_encoding など
IO.open のオプション引数が指定できます。
@see IO.......binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
IO
. read(path , length = nil , offset = 0 , **opt) -> String | nil (3.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...場合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合......e
IO.open のモードを指定します。
"r" で始まる文字列である必要があります。
: :open_args
IO.open に渡される引数を配列で指定します。
これらの他、 :external_encoding など
IO.open のオプション引数が指定できます。
@see IO.......binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
IO
. readlines(path , limit , chomp: false , opts={}) -> [String] (3.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile",......"line1,\rline2,\r\nline3,\n")
IO.readlines("testfile", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}... -
IO
. readlines(path , limit , opts={}) -> [String] (3.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...、ファイルの読み込みに失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}... -
IO
. readlines(path , rs = $ / , chomp: false , opts={}) -> [String] (3.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile",......"line1,\rline2,\r\nline3,\n")
IO.readlines("testfile", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}...