るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file path
  4. file size

ライブラリ

検索結果

Shell#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#out(dev = STDOUT, &block) -> () (13.0)

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

...
Shell
#transact を呼び出しその結果を 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")
}
}...