class Process
Defined in:
process/process.crprocess/run.cr
kernel.cr
Class Method Summary
-
.after_fork_child_callbacks
hooks defined here due to load order problems
- .exit(status = 0)
-
.fork(&block)
Returns a
Process
. -
.fork : self | Nil
Returns a
Process
. - .getpgid(pid : Int32) : LibC::PidT
- .kill(signal : Signal, *pids : Int)
- .pid : LibC::PidT
- .ppid : LibC::PidT
-
.run(cmd : String, args = nil, env : Env = nil, clear_env : Bool = false, shell : Bool = false, input : Stdio = nil, output : Stdio = nil, error : Stdio = nil, chdir : String | Nil = nil, &block)
Executes a process, yields the block, and then waits for it to finish.
-
.run(cmd : String, args = nil, env : Env = nil, clear_env : Bool = false, shell : Bool = false, input : Stdio = false, output : Stdio = false, error : Stdio = false, chdir : String | Nil = nil) : Process::Status
Executes a process and waits for it to complete.
- .times : Tms
-
.new(command : String, args = nil, env : Env = nil, clear_env : Bool = false, shell : Bool = false, input : Stdio = false, output : Stdio = false, error : Stdio = false, chdir : String | Nil = nil)
Creates a process, executes it, but doesn't wait for it to complete.
- .new(pid)
Instance Method Summary
-
#close
Closes any pipes to the child process.
-
#error
A pipe to this process's error.
-
#error? : IO::FileDescriptor | Nil
A pipe to this process's error.
-
#input
A pipe to this process's input.
-
#input? : IO::FileDescriptor | Nil
A pipe to this process's input.
-
#kill(sig = Signal::TERM)
See Process.kill
-
#output
A pipe to this process's output.
-
#output? : IO::FileDescriptor | Nil
A pipe to this process's output.
- #pid : Int32
-
#wait : Process::Status
Waits for this process to complete and closes any pipes.
Instance methods inherited from class Reference
==(other)==(other : self) ==, hash hash, inspect(io : IO) : Nil inspect, object_id : UInt64 object_id, same?(other : Reference)
same?(other : Nil) same?, to_s(io : IO) : Nil to_s
Instance methods inherited from class Object
!=(other)
!=,
!~(other)
!~,
==(other)
==,
===(other)===(other : YAML::Any)
===(other : JSON::Any) ===, =~(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) : self
from_json,
from_yaml(string : String) : self
from_yaml,
hash
hash,
inspect(io)
inspect,
name : String
name,
to_s(io)
to_s,
|(other : U.class)
|
Class Method Detail
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.
Executes a process and waits for it to complete.
By default the process is configured without input, output or error.
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.
Instance Method Detail
A pipe to this process's error. Raises if a pipe wasn't asked when creating the process.
A pipe to this process's error. Raises if a pipe wasn't asked when creating the process.
A pipe to this process's input. Raises if a pipe wasn't asked when creating the process.
A pipe to this process's input. Raises if a pipe wasn't asked when creating the process.
A pipe to this process's output. Raises if a pipe wasn't asked when creating the process.
A pipe to this process's output. Raises if a pipe wasn't asked when creating the process.