A module for working with processes.
Modules
Structs
Iterator over the environment variables.
Describes the result of a process after it has terminated.
Captured output of a child process.
Child process
Builder for creating a forked process.
Builder for creating a process.
Functions
-
Exits the process with a given return code.
This is a graceful exit (
atexit
handlers will run). For an immediate abort, seelibc::_exit
orlibc::abort
.Examples
use std::process::exit; exit(0); // Exit with success
Run this exampleuse std::process::exit; exit(1); // Exit with error
Run this example -
fn env() -> EnvVars
Return environment variables of the current process.
Example
use std::process::env; use std::string::split; let path_dirs = env() .get("PATH") .unwrap() .split(":"); for dir in path_dirs { println!("{}", dir); }
Run this example -
Returns the current working directory as a
PathBuf
. -
Change the current working directory to the specified path.
Enums
Standard I/O stream redirection type