42件ヒット
[1-42件を表示]
(0.072秒)
ライブラリ
- ビルトイン (24)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- IO (24)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
検索結果
先頭5件
-
Shell
# out(dev = STDOUT , &block) -> () (18337.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...の結果を dev に出力します。
@param dev 出力先をIO オブジェクトなどで指定します。
@param block transact 内部で実行するシェルを指定します。
使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){......|fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}... -
Shell
:: CommandProcessor # out(dev = STDOUT , &block) -> () (18337.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...の結果を dev に出力します。
@param dev 出力先をIO オブジェクトなどで指定します。
@param block transact 内部で実行するシェルを指定します。
使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){......|fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}... -
Shell
:: Filter # out(dev = STDOUT , &block) -> () (18337.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...の結果を dev に出力します。
@param dev 出力先をIO オブジェクトなどで指定します。
@param block transact 内部で実行するシェルを指定します。
使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){......|fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}... -
IO
# read(length = nil , outbuf = "") -> String | nil (107.0) -
length バイト読み込んで、その文字列を返します。
...ます。
nil が指定された場合、EOF までの全てのデータを読み込んで、その文字列を返します。
@param outbuf 出力用のバッファを文字列で指定します。IO#read は読み込んだ
データをその文字列オブジェクト......負の場合に発生します。
第二引数を指定した read の呼び出しでデータが空であった場合
(read が nil を返す場合)、outbuf は空文字列になります。
outbuf = "x" * 20;
io = File.open("/dev/null")
p io.read(10,outbuf)
p outbuf
=> nil
""... -
IO
# sysread(maxlen , outbuf = "") -> String (107.0) -
read(2) を用いて入力を行ない、入力されたデータを 含む文字列を返します。stdio を経由しないので gets や getc や eof? などと混用すると思わぬ動作 をすることがあります。
...に 0 が指定されている場合は、空文字列 "" を返します。
@param maxlen 入力のサイズを整数で指定します。
@param outbuf 出力用のバッファを文字列で指定します。IO#sysread は読み込んだデータを
その文字列オブジェク......数を指定した sysread の呼び出しでデータが空であった場
合(sysread が例外 EOFError を発生させる場合)、
outbuf は空文字列になります。
outbuf = "x" * 20;
io = File.open("/dev/null")
p((io.sysread(10,outbuf) rescue nil))
p outbuf
=> nil
""...