るりまサーチ

最速Rubyリファレンスマニュアル検索!
319件ヒット [1-100件を表示] (0.218秒)
トップページ > クラス:IO[x] > クエリ:_builtin[x] > クエリ:puts[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

IO#puts(*obj) -> nil (26136.0)

各 obj を self に出力し、それぞれの後に改行を出力します。 引数の扱いは Kernel.#puts と同じです。詳細はこちらを参照し てください。

...に改行を出力します。
引数の扱いは Kernel.#puts と同じです。詳細はこちらを参照し
てください。

@param obj 出力したいオブジェクトを指定します。Kernel.#puts と同じです。

@raise IOError 自身が書き込み用にオープンされていな...
...ければ発生します。

@raise Errno::EXXX 出力に失敗した場合に発生します。

$stdout.puts("this", "is", "a", "test", [1, [nil, 3]])

#=>
this
is
a
test
1

3

@see Kernel.#puts...

IO.popen("-", mode = "r", opt={}) -> IO (8021.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("-", mode = "r", opt={}) {|io| ... } -> object (8021.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 (8021.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 (8021.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.binwrite(path, string, offset=nil) -> Integer (8019.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...書き込み、
閉じます。

ファイルを開くときの mode が "rb:ASCII-8BIT" で、バイナリモードが有効
である点以外は IO.write と同じです。

Kernel.#open と同様 path の先頭が "|" ならば、"|" に続くコマンドを実行し、コマンドの出力を...
...: どの環境でも同じ。
puts
png[0...16].unpack('C*').map {|c| '%02x' % c }.join(' ')
# => 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52

# binwriteを使用した場合: どの環境でも正しく保存できる。
IO
.binwrite('white.binmode.png', png)
puts
IO.binread('white.binmode.png',...
...
IO
.write('white.txtmode.png', png)
puts
IO.binread('white.txtmode.png', 16).unpack('C*').map {|c| '%02x' % c }.join(' ')
# => 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 (Linux/Macの場合
# => 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 (Windowsの場合
//}

@see c:IO#io_binmode, IO.w...

IO.popen([env = {}, [cmdname, arg0], *args, execopt={}], mode = "r", opt={}) -> IO (8016.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 = {}, [cmdname, arg0], *args, execopt={}], mode = "r", opt={}) {|f| ... } -> object (8016.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 = {}, cmdname, *args, execopt={}], mode = "r", opt={}) -> IO (8016.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 = {}, cmdname, *args, execopt={}], mode = "r", opt={}) {|f| ... } -> object (8016.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 と共通です...

絞り込み条件を変える

<< 1 2 3 ... > >>