るりまサーチ

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

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io each_line
  5. io readlines

キーワード

検索結果

<< < 1 2 3 4 5 > >>

ARGF.class#pos -> Integer (15.0)

ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位 の整数で返します。

...ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位
の整数で返します。

ARGF.pos # => 0
ARGF.gets # => "This is line one\n"
ARGF.pos # => 17

@see IO#pos, IO#tell, ARGF.class#pos=...

ARGF.class#tell -> Integer (15.0)

ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位 の整数で返します。

...ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位
の整数で返します。

ARGF.pos # => 0
ARGF.gets # => "This is line one\n"
ARGF.pos # => 17

@see IO#pos, IO#tell, ARGF.class#pos=...

ARGF.class#binmode -> self (9.0)

self をバイナリモードにします。一度バイナリモードになった後は非バイナリ モードに戻る事はできません。

...test1.png + test2.png = 292B

# $ ruby test.rb test1.png test2.png

ARGF.binmode
ARGF.read.size # => 292

例:
# test1.png - 164B
# test2.png - 128B
# test1.png + test2.png = 292B

# $ ruby test.rb test1.png test2.png

ARGF.read.size # => 290

@see IO#binmode, ARGF.class#binmode?...

ARGF.class#binmode? -> bool (9.0)

ARGF の入力ストリームがバイナリモードなら true を返します。 そうでない場合、false を返します。

...ムがバイナリモードなら true を返します。
そうでない場合、false を返します。

バイナリモードにするためには ARGF.class#binmode を使用します。

ARGF.binmode? # => false
ARGF.binmode
ARGF.binmode? # => true

@see IO#binmode?, ARGF.class#binmode...

ARGF.class#closed? -> bool (9.0)

現在開いている処理対象のファイルがARGFがcloseされていればtrueを返します。

...ルを閉じていないのでfalseになる
ARGF.closed? # => false
ARGF.filename # => "bar"
ARGF.close
# 2つのファイルを開いていたので2度目のARGF.closeで全てのファイルを閉じたためtrueになる
ARGF.closed? # => true

@see IO#closed?, ARGF.class#close...

絞り込み条件を変える

ARGF.class#each_byte -> Enumerator (9.0)

ARGF の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。 ブロック引数byteは0..255のいずれかの整数です。

...現在位置の1バイトについてファイル名を得るには
ARGF.class
#filename を使用します。

ブロックが与えられなかった場合は、Enumerator オブジェクトを生成して返します。

例:

ARGF.each_byte.to_a # => [35, 32, ... 95, 10]

@see IO#each_byte...

ARGF.class#each_byte { |byte| ...} -> self (9.0)

ARGF の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。 ブロック引数byteは0..255のいずれかの整数です。

...現在位置の1バイトについてファイル名を得るには
ARGF.class
#filename を使用します。

ブロックが与えられなかった場合は、Enumerator オブジェクトを生成して返します。

例:

ARGF.each_byte.to_a # => [35, 32, ... 95, 10]

@see IO#each_byte...

ARGF.class#each_char -> Enumerator (9.0)

レシーバに含まれる文字を一文字ずつブロックに渡して評価します。

...ルを最後まで読んだ後は次のファイ
ルの内容を返します。現在位置の1文字についてファイル名を得るには
ARGF.class
#filename を使用します。

ブロックが与えられなかった場合は、Enumerator オブジェクトを生成し
て返します。...
...t2.txt
# $ ruby test.rb test1.txt test2.txt

# test.rb
ARGF.each_char # => #<Enumerator: ARGF:each_char>
ARGF.each_char{|e|p e}

# => "l"
# "i"
# "n"
# "e"
# "1"
# "\n"
# "l"
# "i"
# "n"
# "e"
# "2"
# "\n"

@see IO#each_char...

ARGF.class#each_char { |c| ... } -> self (9.0)

レシーバに含まれる文字を一文字ずつブロックに渡して評価します。

...ルを最後まで読んだ後は次のファイ
ルの内容を返します。現在位置の1文字についてファイル名を得るには
ARGF.class
#filename を使用します。

ブロックが与えられなかった場合は、Enumerator オブジェクトを生成し
て返します。...
...t2.txt
# $ ruby test.rb test1.txt test2.txt

# test.rb
ARGF.each_char # => #<Enumerator: ARGF:each_char>
ARGF.each_char{|e|p e}

# => "l"
# "i"
# "n"
# "e"
# "1"
# "\n"
# "l"
# "i"
# "n"
# "e"
# "2"
# "\n"

@see IO#each_char...

ARGF.class#external_encoding -> Encoding (9.0)

ARGF が処理するファイルに対する外部エンコーディングを返します。 デフォルトは Encoding.default_external です。

...ARGF が処理するファイルに対する外部エンコーディングを返します。
デフォルトは Encoding.default_external です。

ARGF.class
#set_encoding で設定します。

例:

ARGF.external_encoding # => #<Encoding:UTF-8>

@see IO, ARGF.class#internal_encoding...

絞り込み条件を変える

<< < 1 2 3 4 5 > >>