るりまサーチ

最速Rubyリファレンスマニュアル検索!
418件ヒット [1-100件を表示] (0.033秒)

別のキーワード

  1. kernel spawn
  2. kernel exec
  3. kernel system
  4. kernel open
  5. kernel raise

ライブラリ

クラス

  • IO (154)

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Kernel#xpopen(command, *mode) -> IO (27128.0)

command を表示してから IO.popen の実行します。

...command を表示してから IO.popen の実行します。

@param command コマンド名を指定します。

@param mode オープンする IO ポートのモードを指定します。mode の詳細は Kernel.#open 参照して下さい。

@see IO.popen...

Kernel#xpopen(command, *mode) { ... } -> object (27128.0)

command を表示してから IO.popen の実行します。

...command を表示してから IO.popen の実行します。

@param command コマンド名を指定します。

@param mode オープンする IO ポートのモードを指定します。mode の詳細は Kernel.#open 参照して下さい。

@see IO.popen...

Kernel.#spawn(env, program, *args, options={}) -> Integer (21050.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...din), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
false がデフォルトです。

: :exception
Kernel
.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
fa...
...す。
これを用いて、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 では
デフォルトでは非...
...ommand, :close_others=>false) # don't close 3,4,5,... (default)
//}

これを利用して spawn を IO.popen のように使うことができます。
//emlist[][ruby]{
# similar to r = IO.popen(command)
r, w = IO.pipe
pid = spawn(command, :out=>w) # r は子プロセスで閉じられる
w.clos...

Kernel.#spawn(program, *args) -> Integer (21050.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...din), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
false がデフォルトです。

: :exception
Kernel
.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
fa...
...す。
これを用いて、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 では
デフォルトでは非...
...ommand, :close_others=>false) # don't close 3,4,5,... (default)
//}

これを利用して spawn を IO.popen のように使うことができます。
//emlist[][ruby]{
# similar to r = IO.popen(command)
r, w = IO.pipe
pid = spawn(command, :out=>w) # r は子プロセスで閉じられる
w.clos...

Kernel.#spawn(env, program, *args, options={}) -> Integer (21044.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...す。
これを用いて、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 では
デフォルトでは非...
...= spawn(command, :close_others=>false) # don't close 3,4,5,...
//}

これを利用して spawn を IO.popen のように使うことができます。
//emlist[][ruby]{
# similar to r = IO.popen(command)
r, w = IO.pipe
pid = spawn(command, :out=>w) # r は子プロセスで閉じられる
w.clos...
...列を指定します。
@param options オプションパラメータ Hash

@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。

@see Kernel.#system,Kernel.#exec...

絞り込み条件を変える

Kernel.#spawn(program, *args) -> Integer (21044.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...す。
これを用いて、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 では
デフォルトでは非...
...= spawn(command, :close_others=>false) # don't close 3,4,5,...
//}

これを利用して spawn を IO.popen のように使うことができます。
//emlist[][ruby]{
# similar to r = IO.popen(command)
r, w = IO.pipe
pid = spawn(command, :out=>w) # r は子プロセスで閉じられる
w.clos...
...列を指定します。
@param options オプションパラメータ Hash

@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。

@see Kernel.#system,Kernel.#exec...

Kernel.#exec(env, program, *args, options={}) -> () (21042.0)

引数で指定されたコマンドを実行します。

...イルデスクリプタなど)引き継ぎます。
Hash を options として渡すことで、この挙動を変更できます。
詳しくは Kernel.#spawn を参照してください。

=== 引数の解釈

この形式で呼び出した場合、空白や shell のメタキャラクタも
...
...替えて以下を実行
$ ps aux|grep sleep
xxxx 32754 0.0 0.0 2580 468 pts/3 S+ 22:01 0:00 mysleep 600
xxxx 32761 0.0 0.0 2824 792 pts/6 S+ 22:01 0:00 grep sleep

@see Kernel.#system,Kernel.#`,Kernel.#spawn,Kernel.#fork,IO.popen,IO.pipe,Kernel.#open,exec(3)...

Kernel.#exec(program, *args, options={}) -> () (21042.0)

引数で指定されたコマンドを実行します。

...イルデスクリプタなど)引き継ぎます。
Hash を options として渡すことで、この挙動を変更できます。
詳しくは Kernel.#spawn を参照してください。

=== 引数の解釈

この形式で呼び出した場合、空白や shell のメタキャラクタも
...
...替えて以下を実行
$ ps aux|grep sleep
xxxx 32754 0.0 0.0 2580 468 pts/3 S+ 22:01 0:00 mysleep 600
xxxx 32761 0.0 0.0 2824 792 pts/6 S+ 22:01 0:00 grep sleep

@see Kernel.#system,Kernel.#`,Kernel.#spawn,Kernel.#fork,IO.popen,IO.pipe,Kernel.#open,exec(3)...

Kernel.#spawn(command, options={}) -> Integer (21020.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。


@see Kernel.#system,Kernel.#exec...

Kernel.#spawn(env, command, options={}) -> Integer (21020.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。


@see Kernel.#system,Kernel.#exec...

絞り込み条件を変える

Kernel.#spawn(command, options={}) -> Integer (21019.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。


@see Kernel.#system,Kernel.#exec...

Kernel.#spawn(env, command, options={}) -> Integer (21019.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。


@see Kernel.#system,Kernel.#exec...

Kernel.#fork -> Integer | nil (21018.0)

fork(2) システムコールを使ってプロセスの複製を作 ります。親プロセスでは子プロセスのプロセスIDを、子プロセスでは nil を返します。ブロックを指定して呼び出した場合には、生成し た子プロセスでブロックを評価します。

...puts "parent process. pid: #{Process.pid}, child pid: #{child_pid}"
# => parent process. pid: 79055, child pid: 79602

# 親プロセスでの処理
# ...

# 子プロセスの終了を待って終了。
Process.waitpid(child_pid)
//}


@see IO.popen,IO.pipe,Kernel.#at_exit,Kernel.#exit!, fork(2)...

Kernel.#fork { ... } -> Integer | nil (21018.0)

fork(2) システムコールを使ってプロセスの複製を作 ります。親プロセスでは子プロセスのプロセスIDを、子プロセスでは nil を返します。ブロックを指定して呼び出した場合には、生成し た子プロセスでブロックを評価します。

...puts "parent process. pid: #{Process.pid}, child pid: #{child_pid}"
# => parent process. pid: 79055, child pid: 79602

# 親プロセスでの処理
# ...

# 子プロセスの終了を待って終了。
Process.waitpid(child_pid)
//}


@see IO.popen,IO.pipe,Kernel.#at_exit,Kernel.#exit!, fork(2)...
<< 1 2 3 ... > >>