るりまサーチ

最速Rubyリファレンスマニュアル検索!
60件ヒット [1-60件を表示] (0.088秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

検索結果

StringIO#reopen(sio) -> StringIO (18117.0)

自身が表す文字列が指定された StringIO と同じものになります。

...が指定された StringIO と同じものになります。

@param sio 自身が表したい StringIO を指定します。

//emlist[例][ruby]{
require 'stringio'
sio = StringIO.new("hoge", 'r+')
sio2 = StringIO.new("foo", 'r+')
sio.reopen(sio2)
p sio.read #=> "foo"
//}...

StringIO#reopen(str, mode = 'r+') -> StringIO (18117.0)

自身が表す文字列が指定された文字列 str になります。

...を指定します。

@raise Errno::EACCES str がフリーズされていて、mode が書き込み可能に設定されている場合に発生します。

//emlist[例][ruby]{
require 'stringio'
sio = StringIO.new("hoge", 'r+')
sio.reopen('foo')
p sio.read #=> "foo"
//}...

IO#reopen(path) -> self (18116.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...す。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # =>...

IO#reopen(path, mode) -> self (18116.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...す。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # =>...

IO#reopen(io) -> self (18106.0)

自身を指定された io に繋ぎ換えます。

自身を指定された io に繋ぎ換えます。

クラスも io に等しくなることに注意してください。
IO#pos, IO#lineno などは指定された io と等しくなります。

@param io 自身を繋ぎ換えたい IO オブジェクトを指定します。

@raise IOError 指定された io が close されている場合に発生します。

絞り込み条件を変える