るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.050秒)
トップページ > クエリ:File.open[x] > クエリ:sysread[x] > クラス:Shell::CommandProcessor[x]

別のキーワード

  1. argf.class lines
  2. argf.class each
  3. argf.class each_line
  4. argf.class gets
  5. argf.class to_a

ライブラリ

キーワード

検索結果

Shell::CommandProcessor#open(path, mode) -> File | Dir (18269.0)

path がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。

...がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。

@param path 開きたいパスを指定します。

@param mode アクセスモードを指定します。path がディレクトリの場合は無視されます。

@see File.open, Dir.open...

Shell::CommandProcessor#out(dev = STDOUT, &block) -> () (13.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ェクトなどで指定します。

@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")
}
}...