Results for: "to_proc"

Returns the name of the script being executed. The value is not affected by assigning a new value to $0.

This method first appeared in Ruby 2.1 to serve as a global variable free means to get the script name.

Like Process.wait, but returns a Process::Status object (instead of an integer pid or nil); see Process.wait for the values of pid and flags.

If there are child processes, waits for a child process to exit and returns a Process::Status object containing information on that process; sets thread-local variable $?:

Process.spawn('cat /nop') # => 1155880
Process::Status.wait      # => #<Process::Status: pid 1155880 exit 1>
$?                        # => #<Process::Status: pid 1155508 exit 1>

If there is no child process, returns an “empty” Process::Status object that does not represent an actual process; does not set thread-local variable $?:

Process::Status.wait # => #<Process::Status: pid -1 exit 0>
$?                   # => #<Process::Status: pid 1155508 exit 1> # Unchanged.

May invoke the scheduler hook Fiber::Scheduler#process_wait.

Not available on all platforms.

Returns whether the value of to_i == other:

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

Returns a string representation of self:

system("false")
$?.inspect # => "#<Process::Status: pid 1303494 exit 1>"

Returns the process ID of the process:

system("false")
$?.pid # => 1247002

Returns true if the process terminated because of an uncaught signal, false otherwise.

Returns the number of the signal that caused the process to terminate or nil if the process was not terminated by an uncaught signal.

Returns true if the process exited normally (for example using an exit() call or finishing the program), false if not.

Returns the least significant eight bits of the return code of the process if it has exited; nil otherwise:

`exit 99`
$?.exitstatus # => 99

Returns:

Returns true if the process generated a coredump when it terminated, false if not.

Not available on all platforms.

Returns the (real) user ID of the current process.

Process.uid # => 1000

Returns the effective user ID for the current process.

Process.euid # => 501

Exchange real and effective user IDs and return the new effective user ID. Not available on all platforms.

[Process.uid, Process.euid]   #=> [0, 31]
Process::UID.re_exchange      #=> 0
[Process.uid, Process.euid]   #=> [31, 0]

Returns true if the real and effective user IDs of a process may be exchanged on the current platform.

Returns true if the current platform has saved user ID functionality.

Switch the effective and real user IDs of the current process. If a block is given, the user IDs will be switched back after the block is executed. Returns the new effective user ID if called without a block, and the return value of the block if one is given.

Returns the (real) group ID for the current process:

Process.gid # => 1000

Returns the effective group ID for the current process:

Process.egid # => 500

Not available on all platforms.

Exchange real and effective group IDs and return the new effective group ID. Not available on all platforms.

[Process.gid, Process.egid]   #=> [0, 33]
Process::GID.re_exchange      #=> 0
[Process.gid, Process.egid]   #=> [33, 0]

Returns true if the real and effective group IDs of a process may be exchanged on the current platform.

Returns true if the current platform has saved group ID functionality.

Switch the effective and real group IDs of the current process. If a block is given, the group IDs will be switched back after the block is executed. Returns the new effective group ID if called without a block, and the return value of the block if one is given.

Returns the (real) user ID of the current process.

Process.uid # => 1000

Returns the effective user ID for the current process.

Process.euid # => 501
Search took: 3ms  ·  Total Results: 1563