種類
- インスタンスメソッド (66)
- 文書 (15)
- クラス (11)
- 変数 (11)
クラス
- File (11)
-
Process
:: Status (55)
モジュール
- Kernel (11)
キーワード
-
$ CHILD _ STATUS (11) - & (11)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - == (11)
- >> (11)
-
NEWS for Ruby 3
. 0 . 0 (4) - Status (11)
- flock (11)
-
to
_ s (11)
検索結果
先頭5件
-
Process
:: Status # to _ i -> Integer (21101.0) -
C 言語での終了ステータス表現の整数を返します。
C 言語での終了ステータス表現の整数を返します。
多くのシステムの実装では、この値の上位 8 bit に exit(2)
に渡した終了ステータスが、下位 8 bit にシグナル等で終了した等の情
報が入っています。 -
Process
:: Status (3076.0) -
プロセスの終了ステータスを表すクラスです。 メソッド Process.#wait2 などの返り値として使われます。
...プロセスの終了ステータスを表すクラスです。
メソッド Process.#wait2 などの返り値として使われます。
=== 使用例
wait を使用した例
fork { exit }
Process.wait
case
when $?.signaled?
p "child #{$?.pid} was killed by signal #{$?.termsig}"......?
# 実際には Process.wait を使用しているので、ここに来ることはない
p "child #{$?.pid} was stopped by signal #{$?.stopsig}"
when $?.exited?
p "child #{$?.pid} exited normally. status=#{$?.exitstatus}"
else
p "unknown status %#x" % $?.to_i
end
SIGCHLD を......了に対して1つの SIGCHLD しか届かない
# 場合があるのでループさせる必要があります
while Process.waitpid(-1, Process::WNOHANG|Process::WUNTRACED)
case
when $?.signaled?
puts " child #{$?.pid} was killed by signal #{$?.termsig}"
if... -
Process
:: Status # >>(num) -> Integer (3028.0) -
self.to_i >> num と同じです。
...self.to_i >> num と同じです。
@param num 整数を指定します。
fork { exit 99 } #=> 26563
Process.wait #=> 26563
$?.to_i #=> 25344
$? >> 8 #=> 99... -
Process
:: Status # &(other) -> Integer (3016.0) -
self.to_i & other と同じです。 このメソッドは後方互換性のためにあります。
...self.to_i & other と同じです。
このメソッドは後方互換性のためにあります。
@param other 自身との & 演算をしたい整数を指定します。... -
Process
:: Status # to _ s -> String (3016.0) -
to_i.to_s と同じです。
...
to_i.to_s と同じです。... -
Process
:: Status # ==(other) -> bool (3006.0) -
同じステータスの場合に真を返します。
...同じステータスの場合に真を返します。
other が数値の場合、self.to_i との比較が行われます。こ
れは後方互換性のためです。
@param other 自身と比較したいオブジェクトを指定します。... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (276.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...fix として 0d が追加されました。
8進リテラルの prefix として 0 以外に 0o が追加されました。
Integer(), String#to_i、String#oct もこの prefix を認識します。
: ((<メソッド引数の & 修飾|メソッド呼び出し/イテレータ>)) [compat]
: ((<......追加されたクラス/モジュール
: ((<Process::UID>)) [new]
: ((<Process::GID>)) [new]
: ((<Process::Sys>)) [new]
: ((<Signal>)) モジュール [new]
: ((<Process::Status>)) [new]
: ((<NoMethodError>)) [new]
((<Process::Status>)) の追加により、(({$?})) の値......::Stat/rdev_major>)) [new]
: ((<File::Stat#rdev_minor|File::Stat/rdev_minor>)) [new]
追加
=== Float
: ((<Numeric#to_int|Numeric/to_int>)) [new]
: ((<Float#to_int|Numeric/to_int>)) [new]
追加。
=== Hash
: ((<Hash#merge|Hash/merge>)) [new]
: ((<Hash#merge!|Hash/merge!>)) [new]
追加... -
Kernel
$ $ CHILD _ STATUS -> Process :: Status | nil (107.0) -
$? の別名
...$? の別名
require "English"
out = `wget https://www.ruby-lang.org/en/about/license.txt -O - 2>/dev/null`
if $CHILD_STATUS.to_i == 0
print "wget success\n"
out.split(/\n/).each { |line|
printf "%s\n", line
}
else
print "wget failed\n"
end... -
File
# flock(operation) -> 0 | false (66.0) -
ファイルをロックします。
...モードに"w"を使ってはいけません。
File.open("counter", File::RDWR|File::CREAT, 0644) {|f|
f.flock(File::LOCK_EX)
value = f.read.to_i + 1
f.rewind
f.write("#{value}\n")
f.flush
f.truncate(f.pos)
}
# 読み込みロック(read lock)を使用してカウンタを読み込......o", "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.flock(File::LOCK_UN)
puts "unlocked by process1"
sleep 1 # <- 子プロセスが確実に先......にロックするための sleep
f.flock(File::LOCK_EX)
puts "re-locked by process1"
# => locked by process1
# unlocked by process1
# locked by process2
# unlocked by process2
# re-locked by process1
//}... -
NEWS for Ruby 3
. 0 . 0 (18.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...`Kernel`: `#class`, `#frozen?`
* `Integer`: `#-@`, `#~`, `#abs`, `#bit_length`, `#even?`, `#integer?`, `#magnitude`, `#odd?`, `#ord`, `#to_i`, `#to_int`, `#zero?`
* `Struct`: reader methods for 10th or later members
* Constant references are inlined.
* Always generate appropr......n a receiver class.
* Reduce the number of PC accesses on branches and method returns.
* Optimize C method calls a little.
* Compilation process improvements
* It does not keep temporary files in /tmp anymore.
* Throttle GC and compaction of JIT-ed code.
* Avoid GC-ing JIT-ed c......enerics, and _interface types_ for duck typing.
* Ruby ships with type definitions for core/stdlib classes.
* `rbs` gem is bundled to load and process RBS files.
=== TypeProf
* TypeProf is a type analysis tool for Ruby code based on abstract interpretation.
* It reads non-annotated Ruby...