検索結果
先頭5件
-
FileUtils
. # chdir(dir , options = {}) -> 0 (15209.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) -> nil (15209.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) {|dir| . . . . } -> nil (15209.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) {|dir| . . . . } -> object (15209.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
Process
. # daemon(nochdir = nil , noclose = nil) -> 0 (201.0) -
プロセスから制御端末を切り離し、 バックグラウンドにまわってデーモンとして動作させます。
...クグラウンドにまわってデーモンとして動作させます。
カレントディレクトリを / に移動します。
ただし nochdir に真を指定したときにはこの動作は抑制され、
カレントディレクトリは移動しません。
標準入力・標準出力......す。
ただし noclose に真を指定したときにはこの動作は抑制され、
リダイレクトは行なわれません。
@param nochdir true を指定した場合、カレントディレクトリを移動しません。
@param noclose true を指定した場合、標準入力・標... -
Kernel
. # spawn(env , program , *args , options={}) -> Integer (131.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...します。詳しくは Process.#setrlimit を見て
ください。引数には整数、もしくは整数2つの配列を渡します。
: :chdir
指定した文字列をカレントディレクトリにします。
: :umask
指定した整数を umask に設定します。
: リダイ......出せなくする
pid = spawn(command, :rlimit_core=>0) # never dump core.
//}
「:chdir」で子プロセスのカレントディレクトリを変更できます。
//emlist[][ruby]{
pid = spawn(command, :chdir=>"/var/tmp")
//}
「:umask」で子プロセスの umask を指定できます。
//......を用いて、IO.popen で、子プロセスの
stderr と stdout を混ぜる例を以下に示します。
//emlist[][ruby]{
io = IO.popen(["sh", "-c", "echo out; echo err >&2", :err=>[:child, :out]])
p io.read #=> "out\nerr\n
//}
spawn と IO.popen では
デフォルトでは非標準的なフ... -
Kernel
. # spawn(program , *args) -> Integer (131.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...します。詳しくは Process.#setrlimit を見て
ください。引数には整数、もしくは整数2つの配列を渡します。
: :chdir
指定した文字列をカレントディレクトリにします。
: :umask
指定した整数を umask に設定します。
: リダイ......出せなくする
pid = spawn(command, :rlimit_core=>0) # never dump core.
//}
「:chdir」で子プロセスのカレントディレクトリを変更できます。
//emlist[][ruby]{
pid = spawn(command, :chdir=>"/var/tmp")
//}
「:umask」で子プロセスの umask を指定できます。
//......を用いて、IO.popen で、子プロセスの
stderr と stdout を混ぜる例を以下に示します。
//emlist[][ruby]{
io = IO.popen(["sh", "-c", "echo out; echo err >&2", :err=>[:child, :out]])
p io.read #=> "out\nerr\n
//}
spawn と IO.popen では
デフォルトでは非標準的なフ... -
Open3
. # popen3(*cmd) -> [IO , IO , IO , Thread] (125.0) -
外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。
...つためのスレッドを 4 要素の
配列で返します。
require 'open3'
stdin, stdout, stderr, wait_thr = *Open3.popen3("/usr/bin/nroff -man")
@param cmd 実行するコマンドを指定します。
@return ブロックを指定した場合はブロックの最後に評価された......:
require "open3"
# オプションを指定した場合。
Dir.chdir("/tmp")
Open3.popen3("pwd", :chdir=> "/") {|i,o,e,t|
p o.read.chomp #=> "/"
}
# オプションを指定しない場合。
Dir.chdir("/tmp")
Open3.popen3("pwd") {|i,o,e,t|
p o.read.chomp #=> "/tmp"... -
Open3
. # popen3(*cmd) {|stdin , stdout , stderr , wait _ thr| . . . } -> () (125.0) -
外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。
...つためのスレッドを 4 要素の
配列で返します。
require 'open3'
stdin, stdout, stderr, wait_thr = *Open3.popen3("/usr/bin/nroff -man")
@param cmd 実行するコマンドを指定します。
@return ブロックを指定した場合はブロックの最後に評価された......:
require "open3"
# オプションを指定した場合。
Dir.chdir("/tmp")
Open3.popen3("pwd", :chdir=> "/") {|i,o,e,t|
p o.read.chomp #=> "/"
}
# オプションを指定しない場合。
Dir.chdir("/tmp")
Open3.popen3("pwd") {|i,o,e,t|
p o.read.chomp #=> "/tmp"... -
FileUtils
. # cd(dir , options = {}) -> 0 (109.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # cd(dir , options = {}) -> nil (109.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # cd(dir , options = {}) {|dir| . . . . } -> nil (109.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # cd(dir , options = {}) {|dir| . . . . } -> object (109.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
Kernel
. # spawn(command , options={}) -> Integer (106.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
引数を外部コマンドとして実行しますが、生成した
子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
=== 引数の解釈
この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。
@param command コマンドを文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options オプションパラメータ Hash...