276件ヒット
[1-100件を表示]
(0.025秒)
クラス
-
ARGF
. class (12)
モジュール
- Kernel (48)
- Open3 (72)
-
OpenSSL
:: ASN1 (12)
キーワード
-
$ INPUT _ LINE _ NUMBER (12) -
$ NR (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) -
NEWS for Ruby 2
. 1 . 0 (12) - decode (12)
-
pipeline
_ r (24) -
pipeline
_ rw (24) -
pipeline
_ start (12) -
pipeline
_ w (12) -
rb
_ mod _ attr _ reader (12) -
rb
_ thread _ join _ m (12) -
rb
_ thread _ raise (12) -
rb
_ thread _ raise _ m (12) -
rb
_ thread _ s _ new (12) - readline (12)
- readlines (12)
-
rinda
/ rinda (12) - rss (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12)
検索結果
先頭5件
- ARGF
. class # read(length = nil , str = nil) -> String | nil - static VALUE rb
_ thread _ join _ m(int argc , VALUE *argv , VALUE thread) - static VALUE rb
_ thread _ raise(int argc , VALUE *argv , rb _ thread _ t th) - static VALUE rb
_ thread _ raise _ m(int argc , VALUE *argv , VALUE thread) - static VALUE rb
_ mod _ attr _ reader(int argc , VALUE *argv , VALUE klass)
-
ARGF
. class # read(length = nil , str = nil) -> String | nil (18153.0) -
ARGVに指定されたファイルを先頭のファイルからlengthバイト読み込み、 その文字列をstrに出力します。読み込んだ文字列を返します。
...
ARGVに指定されたファイルを先頭のファイルからlengthバイト読み込み、
その文字列をstrに出力します。読み込んだ文字列を返します。
@param length 読み込むバイト数を指定します。nilの場合はARGVのすべてのファ
イ......tr 出力先の文字列。内容は上書きされます。
$ echo "small" > small.txt
$ echo "large" > large.txt
$ ruby glark.rb small.txt large.txt
ARGF.read # => "small\nlarge"
ARGF.read(200) # => "small\nlarge"
ARGF.read(2) # => "sm"
ARGF.read(0) # => ""
@see IO#read... -
static VALUE rb
_ thread _ join _ m(int argc , VALUE *argv , VALUE thread) (6300.0) -
-
static VALUE rb
_ thread _ raise(int argc , VALUE *argv , rb _ thread _ t th) (6300.0) -
-
static VALUE rb
_ thread _ raise _ m(int argc , VALUE *argv , VALUE thread) (6300.0) -
-
static VALUE rb
_ mod _ attr _ reader(int argc , VALUE *argv , VALUE klass) (6200.0) -
-
static VALUE rb
_ thread _ s _ new(int argc , VALUE *argv , VALUE klass) (6200.0) -
-
Kernel
. # readline(rs = $ / ) -> String (6124.0) -
ARGFから一行読み込んで、それを返します。 行の区切りは引数 rs で指定した文字列になります。
...文字列になります。
rs に nil を指定すると行区切りなしとみなしてファイルの内容を
すべて読み込みます。ARGVに複数のファイル名が存在する場合は1度に1ファイルずつ読み込みます。
空文字列 "" を指定すると連続する改......生します。
@raise EOFError readline でファイル末端(EOF)を検出すると発生します。
//emlist[例][ruby]{
# ---main.rb---
ARGV << 'b.txt' << 'c.txt'
p readline #=> "hello\n"
p readline(nil) #=> "it\ncommon\n"
p readline("") #=> "ARGF\n\n"
p readline('、') #=> "スクリプトに......なして、"
p readline #=> "それらのファイルを連結した 1 つの仮想ファイルを表すオブジェクトです。 \n"
p readline # end of file reached (EOFError)
# --- b.txt ---
hello
it
common
# --- c.txt ---
ARGF
# スクリプトに指定した引数 (Object::ARGV を参照)... -
Kernel
. # readlines(rs = $ / ) -> [String] (6124.0) -
ARGFを Kernel.#gets(rs) でEOFまで読み込んで、その各行を要素としてもつ配列を返します。 行の区切りは引数 rs で指定した文字列になります。
...list[main.rb][ruby]{
ARGV << 'b.txt' << 'b.txt'
p readlines #=> ["hello\n", "it\n", "\n", "common\n", "hello\n", "it\n", "\n", "common\n"]
ARGV << 'b.txt' << 'b.txt'
p readlines(nil) #=> ["hello\nit\n\ncommon\n", "hello\nit\n\ncommon\n"]
ARGV << 'b.txt' << 'b.txt'
p readlines("") #=> ["he......llo\nit\n\n", "common\n", "hello\nit\n\n", "common\n"]
ARGV << 'b.txt' << 'b.txt'
p readlines('it') #=> ["hello\nit", "\n\ncommon\n", "hello\nit", "\n\ncommon\n"]
p readlines #=> []
//}
//emlist[b.txt][ruby]{
hello
it
common
//}
@see $/,ARGF,Kernel.#gets, Kernel.#readline... -
Open3
. # pipeline _ r(*cmds) -> [IO , [Thread]] (112.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。最後の コマンドの標準出力を受けとる事ができます。
...(1) commandline
(2) [commandline, options]
(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]
@return ブロックを指定した場合はブロックの最後に評価された値を返します。
ブロッ......待つためのスレッドの配列を配列で返します。
例:
require "open3"
Open3.pipeline_r("yes", "head -10") {|r, ts|
p r.read #=> "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"
p ts[0].value #=> #<Process::Status: pid 24910 SIGPIPE (signal 13)>
p ts[1].value #=> #<Process::S...