種類
- 変数 (55)
- 特異メソッド (44)
- インスタンスメソッド (33)
- モジュール関数 (22)
- 文書 (20)
キーワード
-
$ > (11) -
$ DEFAULT _ OUTPUT (11) -
$ stderr (11) -
$ stdin (11) -
$ stdout (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 3 . 0 (9) - open (44)
- open! (11)
検索結果
先頭5件
-
IO
# reopen(path) -> self (18127.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...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") # => #<File:testfile>
f2.readline... -
IO
# reopen(path , mode) -> self (18127.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...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") # => #<File:testfile>
f2.readline... -
IO
# reopen(io) -> self (18107.0) -
自身を指定された io に繋ぎ換えます。
自身を指定された io に繋ぎ換えます。
クラスも io に等しくなることに注意してください。
IO#pos, IO#lineno などは指定された io と等しくなります。
@param io 自身を繋ぎ換えたい IO オブジェクトを指定します。
@raise IOError 指定された io が close されている場合に発生します。 -
Syslog
. # reopen(ident= $ 0 , options=Syslog :: LOG _ PID|Syslog :: LOG _ CONS , facility=Syslog :: LOG _ USER) { |syslog| . . . } -> self (15107.0) -
開いていた syslog を最初にクローズする点を除いてSyslog.#open と同じです。
...log.open!("syslogtest2")
Syslog.log(Syslog::LOG_WARNING, "the sky is falling in %d seconds!", 200)
rescue RuntimeError => err
# RuntimeError は発生しない。
puts err
end
File.foreach('/var/log/system.log'){|line|
print line if line =~ /the sky is/
}
@see Syslog.#open... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (378.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...り、(({$?})) の値も整数からこのクラ
スのインスタンスになりました。
=== クラス階層
: ((<File::Constants>))
File::Constants は、File クラスでなく IO クラスが include するように
なりました。((<ruby-dev:20964>))
: ((<UnboundMethod>)) [com......。($deferr はすぐに obsolete に
なりました。$stderr を使ってください)
=== ARGF
: ((<ARGF/ARGF.path>)) [new]
追加 (ARGF.filename の別名) ((<ruby-dev:20197>))
=== Array
: ((<Array#transpose|Array/transpose>)) [new]
追加
: ((<Array#zip|Enumerable/zip>)) [new]
: (......キーが渡されます
=== IO
: ((<IO/IO.new>)) [compat]
((<File/File.open>)) と同様に mode を数値(つまり、
((<File::Constants>)) の定数) で指定できるようになりました。
: ((<IO#reopen|IO/reopen>)) [compat]
第二引数を省略したときレシーバのモ... -
CSV
. open(filename , mode = "rb" , options = Hash . new) -> CSV (148.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#intern......ctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定.......new のオプションと同じオプションを指定できます。
//emlist[例 読み取り・ブロック指定なし][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.open("test.csv... -
CSV
. open(filename , mode = "rb" , options = Hash . new) {|csv| . . . } -> nil (148.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#intern......ctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定.......new のオプションと同じオプションを指定できます。
//emlist[例 読み取り・ブロック指定なし][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.open("test.csv... -
CSV
. open(filename , options = Hash . new) -> CSV (148.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#intern......ctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定.......new のオプションと同じオプションを指定できます。
//emlist[例 読み取り・ブロック指定なし][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.open("test.csv... -
CSV
. open(filename , options = Hash . new) {|csv| . . . } -> nil (148.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#intern......ctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定.......new のオプションと同じオプションを指定できます。
//emlist[例 読み取り・ブロック指定なし][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.open("test.csv... -
NEWS for Ruby 2
. 3 . 0 (66.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
..._while
10769
* Enumerator::Lazy
* Enumerator::Lazy#grep_v を追加
11773
* File
* File.mkfifo
11536
* O_TMPFILE に対応する File::TMPFILE(File::Constants::TMPFILE) を追加
* Hash
* Hash#fetch_values を追加
10017
* Hash#dig を追加......643
* Hash#<=, Hash#<, Hash#>=, Hash#> を追加
10984
* Hash#to_proc を追加
11653
* IO
* 新しいフラグ File::SHARE_DELETE(File::Constants::SHARE_DELETE) が使用できます。
Windows で開いているファイルを削除することを許可しますが......るようになりました。(大文字・小文字を区別しません)
11695
* ログデバイスを開きなおすために Logger#reopen が追加されました。
11696
* io/wait
* IO#wait_readable は FIONREAD をチェックしなくなりました。
ソケッ...