Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Process::Status#to_i

stat.to_i → integer

Returns the bits in stat as an Integer. Poking around in these bits is platform dependent.

Example
fork { exit 0xab }         #=> 26566
Process.wait               #=> 26566
sprintf('%04x', $?.to_i)   #=> "ab00"
See also #termsig #to_s #success? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1