123456789_123456789_123456789_123456789_123456789_

Top Level Namespace

Constant Summary

Class Attribute Summary

Class Method Summary

Class Attribute Details

$! (readonly)

Process.pidFixnum (readonly)

Returns the process id of this process. Not available on all platforms.

Process.pid   #=> 27415

$& (readonly)

$' (readonly)

$*(*var) (readonly)

$+ (readonly)

$, (rw)

$-0 (rw)

Alias for $/.

$-d (readonly)

Alias for $DEBUG.

$-F (readonly)

Alias for $;.

$-i(*var) (rw)

$-K (rw)

Alias for $KCODE.

$-v (rw)

Alias for $VERBOSE.

$-W() (readonly)

$-w (rw)

Alias for $VERBOSE.

$.(*var) (rw)

$/ (rw) Also known as: ::$-0

avoid modifying RS_default

$0 (rw) Also known as: ::$PROGRAM_NAME

$; (readonly) Also known as: ::$-F

$< (readonly)

$= (rw)

$> (rw)

Alias for $stdout.

$@ (rw)

$\ (readonly) Also known as: ::$LOADED_FEATURES

$\\ (rw)

$_ (rw)

$` (readonly)

$DEBUG (readonly) Also known as: ::$-d

$FILENAME(*var) (readonly)

$find_time_numguess (readonly)

$KCODE (rw) Also known as: ::$-K

$LOADED_FEATURES (readonly)

Alias for $.

$PROGRAM_NAME (rw)

Alias for $0.

$SAFE (rw)

$stderr (rw)

$stdin (readonly)

$stdout (rw) Also known as: ::$>

$VERBOSE (rw) Also known as: ::$-v, ::$-w

! Defines built-in variables

$VERBOSE= (rw) Also known as: ::$-v=, ::$-w=

! Defines built-in variables

$~ (rw)

Class Method Details

$?Boolean

::Process::Status encapsulates the information on the status of a running or terminated system process. The built-in variable $? is either nil or a ::Process::Status object.

fork { exit 99 }   #=> 26557
Process.wait       #=> 26557
$?.class           #=> Process::Status
$?.to_i            #=> 25344
$? >> 8            #=> 99
$?.stopped?        #=> false
$?.exited?         #=> true
$?.exitstatus      #=> 99

Posix systems record information on processes using a 16-bit integer. The lower bits record the process status (stopped, exited, signaled) and the upper bits possibly contain additional information (for example the program's return code in the case of exited processes). Pre Ruby 1.8, these bits were exposed directly to the Ruby program. Ruby now encapsulates these in a ::Process::Status object. To maximize compatibility, however, these objects retain a bit-oriented interface. In the descriptions that follow, when we talk about the integer value of stat, we're referring to this 16 bit value.