class Process

Defined in:

process/process.cr
process/run.cr
kernel.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class Reference

! !, ==(other)
==(other : self)
==
, hash hash, inspect(io : IO) : Nil inspect, nil? nil?, object_id object_id, same?(other : Nil)
same?(other : Reference)
same?
, to_s(io : IO) : Nil to_s

Instance methods inherited from class Object

! !, !=(other) !=, !~(other) !~, ==(other) ==, ===(other) ===, =~(other) =~, class class, clone clone, crystal_type_id crystal_type_id, dup dup, hash hash, inspect
inspect(io : IO)
inspect
, itself itself, not_nil! not_nil!, tap(&block) tap, to_json to_json, to_pretty_json(io : IO)
to_pretty_json
to_pretty_json
, to_s
to_s(io : IO)
to_s
, to_yaml(io : IO)
to_yaml
to_yaml
, try(&block) try

Class methods inherited from class Object

==(other : Class) ==, ===(other) ===, cast(other) : self cast, from_json(string_or_io) from_json, from_yaml(string : String) from_yaml, hash hash, inspect(io) inspect, name : String name, to_s(io) to_s

Class Method Detail

def self.exit(status = 0) #

[View source]
def self.fork(&block) #

Returns a Process.


[View source]
def self.fork #

Returns a Process.


[View source]
def self.getpgid(pid : Int32) #

[View source]
def self.kill(signal : Signal, *pids : Int) #

[View source]
def self.pid #

[View source]
def self.ppid #

[View source]
def self.run(cmd : String, args = nil, env = nil : Env, clear_env = false : Bool, shell = false : Bool, input = nil : Stdio, output = nil : Stdio, error = nil : Stdio, chdir = nil : String | Nil, &block) #

Executes a process, yields the block, and then waits for it to finish.

By default the process is configured to use pipes for input, output and error. These will be closed automatically at the end of the block.

Returns the block's value.


[View source]
def self.run(cmd : String, args = nil, env = nil : Env, clear_env = false : Bool, shell = false : Bool, input = false : Stdio, output = false : Stdio, error = false : Stdio, chdir = nil : String | Nil) : Process::Status #

Executes a process and waits for it to complete.

By default the process is configured without input, output or error.


[View source]
def self.times #

[View source]
def self.new(command : String, args = nil, env = nil : Env, clear_env = false : Bool, shell = false : Bool, input = false : Stdio, output = false : Stdio, error = false : Stdio, chdir = nil : String | Nil) #

Creates a process, executes it, but doesn't wait for it to complete.

To wait for it to finish, invoke #wait.

By default the process is configured without input, output or error.


[View source]
def self.new(pid) #

[View source]

Instance Method Detail

def close #

Closes any pipes to the child process.


[View source]
def error #

A pipe to this process's error. Raises if a pipe wasn't asked when creating the process.


[View source]
def error? #

A pipe to this process's error. Raises if a pipe wasn't asked when creating the process.


[View source]
def input #

A pipe to this process's input. Raises if a pipe wasn't asked when creating the process.


[View source]
def input? #

A pipe to this process's input. Raises if a pipe wasn't asked when creating the process.


[View source]
def kill(sig = Signal::TERM) #

See Process.kill


[View source]
def output #

A pipe to this process's output. Raises if a pipe wasn't asked when creating the process.


[View source]
def output? #

A pipe to this process's output. Raises if a pipe wasn't asked when creating the process.


[View source]
def pid #

[View source]
def wait : Process::Status #

Waits for this process to complete and closes any pipes.


[View source]