os
30 items · generated by scribe fromstdlib/os.fd· synced 2026-11-15
Contents
- os_getenv (function)
- os_getenv_or (function)
- os_hasenv (function)
- os_argc (function)
- os_argv (function)
- os_args (function)
- os_exit (function)
- os_exit_success (function)
- os_exit_failure (function)
- os_system (function)
- os_name (function)
- os_home_dir (function)
- os_cwd (function)
- os_user (function)
- os_hostname (function)
- os_shell (function)
- os_term (function)
- os_path (function)
- os_tmp_dir (function)
- os_path_sep (function)
- os_path_list_sep (function)
- env_get (function)
- env_exists (function)
- args_len (function)
- args_get (function)
- args_program_name (function)
os_getenv
Get an environment variable value. Returns "" if not set.
pub fn os_getenv(name: str) -> str {Parameters:
name:str
Returns: str
Defined at line 29
os_getenv_or
Get an environment variable, or a default value if not set.
pub fn os_getenv_or(name: str, default: str) -> str {Parameters:
name:strdefault:str
Returns: str
Defined at line 39
os_hasenv
Check if an environment variable is set.
pub fn os_hasenv(name: str) -> bool {Parameters:
name:str
Returns: bool
Defined at line 48
os_argc
Get the number of command-line arguments.
pub fn os_argc() -> i64 {Returns: i64
Defined at line 55
os_argv
Get a command-line argument by index ("" when out of range).
pub fn os_argv(idx: i64) -> str {Parameters:
idx:i64
Returns: str
Defined at line 60
os_args
Get all command-line arguments as a Vec of strings.
pub fn os_args() -> Vec<str> {Returns: Vec<str>
Defined at line 72
os_exit
Exit the process with a status code.
pub fn os_exit(code: i64) -> void {Parameters:
code:i64
Returns: void
Defined at line 86
os_exit_success
Exit with success (code 0).
pub fn os_exit_success() -> void {Returns: void
Defined at line 91
os_exit_failure
Exit with failure (code 1).
pub fn os_exit_failure() -> void {Returns: void
Defined at line 96
os_system
Execute a system command. Returns the exit status.
pub fn os_system(cmd: str) -> i64 {Parameters:
cmd:str
Returns: i64
Defined at line 101
os_name
Get the operating system name (best-effort, from environment).
pub fn os_name() -> str {Returns: str
Defined at line 108
os_home_dir
Get the user’s home directory.
pub fn os_home_dir() -> str {Returns: str
Defined at line 118
os_cwd
Get the current working directory (from PWD env var).
pub fn os_cwd() -> str {Returns: str
Defined at line 127
os_user
Get the user name (from USER env var).
pub fn os_user() -> str {Returns: str
Defined at line 136
os_hostname
Get the hostname (from HOSTNAME env var, best-effort).
pub fn os_hostname() -> str {Returns: str
Defined at line 149
os_shell
Get the shell (from SHELL env var).
pub fn os_shell() -> str {Returns: str
Defined at line 158
os_term
Get the terminal (from TERM env var).
pub fn os_term() -> str {Returns: str
Defined at line 167
os_path
Get the PATH environment variable as a Vec of paths.
pub fn os_path() -> Vec<str> {Returns: Vec<str>
Defined at line 176
os_tmp_dir
Get the system temporary directory.
pub fn os_tmp_dir() -> str {Returns: str
Defined at line 187
os_path_sep
Get the path separator for this OS.
pub fn os_path_sep() -> str {Returns: str
Defined at line 206
os_path_list_sep
Get the path list separator (for PATH-like variables).
pub fn os_path_list_sep() -> str {Returns: str
Defined at line 211
env_get
Alias for env_get: get an environment variable value.
pub fn env_get(name: str) -> str {Parameters:
name:str
Returns: str
Defined at line 219
env_exists
Alias for env_exists: check if an environment variable is set.
pub fn env_exists(name: str) -> bool {Parameters:
name:str
Returns: bool
Defined at line 224
args_len
Alias for args_len: number of command-line arguments.
pub fn args_len() -> i64 {Returns: i64
Defined at line 229
args_get
Alias for args_get: get a command-line argument by index.
pub fn args_get(idx: i64) -> str {Parameters:
idx:i64
Returns: str
Defined at line 234
args_program_name
Alias for args_program_name: get the program name (argv[0]).
pub fn args_program_name() -> str {Returns: str
Defined at line 239
Generated by scribe, the Fides documentation generator