るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. openssl n
  3. rsa n
  4. pop n_bytes
  5. context prompt_n

ライブラリ

クラス

検索結果

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

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

...#lineno などはリセットされます。

@param path パスを表す文字列を指定します。

@param mode パスを開く際のモードを文字列で指定します。

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

//emlist[例][ruby]{
IO.write("testfile", "This is line on...
...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") # => #<File:testfile>
f2.readlines # => ["This is line on...
...e\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@see Kernel.#open...

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

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

...#lineno などはリセットされます。

@param path パスを表す文字列を指定します。

@param mode パスを開く際のモードを文字列で指定します。

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

//emlist[例][ruby]{
IO.write("testfile", "This is line on...
...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") # => #<File:testfile>
f2.readlines # => ["This is line on...
...e\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@see Kernel.#open...

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

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

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

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

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

@raise IOError...