Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Process::Status#&

(::Integer num) -> ::Integer
stat & mask → integer

This method is deprecated as to_i value is system-specific; use predicate methods like exited? or stopped?, or getters like exitstatus or stopsig.

Returns the logical AND of the value of to_i with mask:

Example
`cat /nop`
stat = $?                 # => #<Process::Status: pid 1155508 exit 1>
sprintf('%x', stat.to_i)  # => "100"
stat & 0x00               # => 0

ArgumentError is raised if mask is negative.

Ruby version changes

  1. 3.3
See also .wait #== #>> also in 3.3 · 3.2 · 3.1 · 3.0