るりまサーチ

最速Rubyリファレンスマニュアル検索!
451件ヒット [101-200件を表示] (0.209秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 ... > >>

IO.popen("-", mode = "r", opt={}) {|io| ... } -> object (8016.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...第一引数に文字列 "-" が指定された時、fork(2) を
行い子プロセスの標準入出力との間にパイプラインを確立します。
親プロセスでは IO オブジェクトを返し、子プロセスでは
nil を返します。

io = IO.popen("-", "r+")
if io # pare...

IO.popen(env, "-", mode = "r", opt={}) -> IO (8016.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...第一引数に文字列 "-" が指定された時、fork(2) を
行い子プロセスの標準入出力との間にパイプラインを確立します。
親プロセスでは IO オブジェクトを返し、子プロセスでは
nil を返します。

io = IO.popen("-", "r+")
if io # pare...

IO.popen(env, "-", mode = "r", opt={}) {|io| ... } -> object (8016.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...第一引数に文字列 "-" が指定された時、fork(2) を
行い子プロセスの標準入出力との間にパイプラインを確立します。
親プロセスでは IO オブジェクトを返し、子プロセスでは
nil を返します。

io = IO.popen("-", "r+")
if io # pare...

Kernel.#exit!(status = false) -> () (8012.0)

Rubyプログラムの実行を即座に終了します。 status として整数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。 デフォルトの終了ステータスは 1 です。

...URE の値なので、正確には環境依存です。

exit! は exit とは違って、例外処理などは一切行ないませ
ん。 Kernel.#fork の後、子プロセスを終了させる時などに用
いられます。

@param status 終了ステータスを整数か true または false...
...T.sync = true #表示前に終了しないようにする
puts 'start'
begin
puts 'start1...'
exit!
ensure
puts 'end1...' #実行されない
end
puts 'end' #実行されない

#=> start
# start1...
#終了ステータス:1
//}

@see Kernel.#exit,Kernel.#abort,Kernel.#at_exit,Kernel.#fork...

File#flock(operation) -> 0 | false (8006.0)

ファイルをロックします。

...f.flock(File::LOCK_SH)
p f.read
}
//}

//emlist[例2:][ruby]{
f = File.open("/tmp/foo", "w")

f.flock(File::LOCK_EX)
puts "locked by process1"

fork
{
f = File.open("/tmp/foo", "r")
f.flock(File::LOCK_SH)
puts "locked by process2"
sleep 5
puts "unlocked by process2"
}

sleep 5

f.floc...

絞り込み条件を変える

Kernel.#at_exit { ... } -> Proc (8006.0)

与えられたブロックをインタプリタ終了時に実行します。

...Proc オブジェクトで返します。

//emlist[例][ruby]{
3.times do |i|
at_exit{puts "at_exit#{i}"}
end
END{puts "END"}
at_exit{puts "at_exit"}
puts "main_end"

#=> main_end
# at_exit
# END
# at_exit2
# at_exit1
# at_exit0
//}

@see d:spec/control#END,Kernel.#exit!,Kernel.#fork...

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

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

...替えて以下を実行
$ 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={}) -> () (8006.0)

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

...替えて以下を実行
$ 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)...

Object#respond_to?(name, include_all = false) -> bool (8006.0)

オブジェクトがメソッド name を持つとき真を返します。

...ッド name を持つというのは、
オブジェクトが メソッド name に応答できることをいいます。

Windows での Process.fork や GNU/Linux での File.lchmod の
ような NotImplementedError が発生する場合は false を返します。

※ NotImplementedError が発...

Process.#detach(pid) -> Thread (8006.0)

子プロセス pid の終了を監視するスレッドを生成して返します。 生成したスレッドは子プロセスが終了した後に終了ステータス (Process::Status) を返します。 指定した子プロセスが存在しなければ即座に nil で終了します。

...す。

@raise NotImplementedError メソッドが現在のプラットフォームで実装されていない場合に発生します。

pid = fork {
# child
sleep 3
}

p pid # => 7762
th = Process.detach(pid)
p th.value
# => #<Process::Status: pid 7762 exit 0>...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>