別のキーワード
ライブラリ
クラス
-
ARGF
. class (66) - BasicSocket (11)
- CSV (33)
- IO (594)
-
IRB
:: StdioInputMethod (11) - StringIO (55)
-
Zlib
:: GzipReader (176)
モジュール
- Kernel (22)
-
OpenSSL
:: Buffering (11) - Timeout (19)
キーワード
-
$ DEFAULT _ INPUT (11) -
$ stdin (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Buffering (11)
- IO (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (4) - NKF (11)
- TCPSocket (11)
- autoclose= (11)
- cooked (11)
- each (88)
-
each
_ byte (22) -
each
_ line (88) - getc (11)
- getsockopt (11)
-
io
/ console (11) - lineno (33)
- lineno= (22)
- new (11)
- noecho (11)
- open (22)
- pipe (88)
- popen (154)
- pos (22)
- pos= (22)
- raw (11)
- read (11)
- readchar (11)
- readline (55)
- readlines (44)
- readpartial (11)
- rewind (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) - shift (11)
- sysread (11)
- tell (22)
- timeout (19)
- ungetc (11)
- 制御構造 (11)
検索結果
先頭5件
-
IO
# gets(limit) -> String | nil (27127.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...il を返します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイ......みバイト数
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets......#=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(limit , chomp: false) -> String | nil (27127.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...il を返します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイ......除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets......#=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs = $ / ) -> String | nil (27127.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...il を返します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイ......みバイト数
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets......#=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs = $ / , chomp: false) -> String | nil (27127.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...il を返します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイ......除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets......#=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs , limit) -> String | nil (27127.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...il を返します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイ......みバイト数
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets......#=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs , limit , chomp: false) -> String | nil (27127.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...il を返します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイ......除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets......#=> nil
$_ #=> nil
@see $/, IO#readline... -
io
/ console (26040.0) -
端末上の入出力を制御するための機能を IO に追加するためのライブラ リです。
... IO に追加するためのライブラ
リです。
例えば、IO#noecho を使ってパスワード入力を端末上に表示しないといっ
た事ができます。同様の事が readline ライブラリでも実現できますが、
そこまでは必要はないけど、 IO#gets や IO#... -
StringIO
# gets(rs = $ / ) -> String | nil (21113.0) -
自身から 1 行読み込んで、その文字列を返します。文字列の終端に到達した時には nil を返します。 $_ に読み込んだ行がセットされます。
...ラグラフモード)。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.gets #=> "hoge"
$_ #=> "hoge"
a.gets #=> nil
$_... -
IRB
:: StdioInputMethod # gets -> String (21101.0) -
標準入力から文字列を 1 行読み込みます。
標準入力から文字列を 1 行読み込みます。 -
Zlib
:: GzipReader # gets(rs = $ / ) -> String | nil (18161.0) -
IO クラスの同名メソッドIO#getsと同じです。
...IO クラスの同名メソッドIO#getsと同じです。
但し、gzip ファイル中に
エラーがあった場合 Zlib::Error 例外や
Zlib::GzipFile::Error 例外が発生します。
gzip ファイルのフッターの処理に注意して下さい。
gzip ファイルのフッターに......* EOF (圧縮データの最後) を越えて読み込み要求を受けた時。
すなわち Zlib::GzipReader#read,
Zlib::GzipReader#gets メソッド等が nil を返す時。
* EOF まで読み込んだ後、Zlib::GzipFile#close メソッドが
呼び出された時。
* EOF......を参照
require 'zlib'
=begin
# hoge.gz がない場合は下記で作成できる。
Zlib::GzipWriter.open('hoge.gz') { |gz|
gz.puts 'hoge'
gz.puts 'fuga'
}
=end
Zlib::GzipReader.open('hoge.gz') { |gz|
while l = gz.gets
puts l
end
}
#=> hoge
#=> fuga... -
ARGF
. class # gets(limit) -> String | nil (18145.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("e......") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(limit , chomp: false) -> String | nil (18145.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("e......") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs = $ / ) -> String | nil (18145.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("e......") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs = $ / , chomp: false) -> String | nil (18145.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("e......") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs , limit) -> String | nil (18145.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("e......") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc...