cwd
fn cwd() -> Result<string, EnvError> Import
Source: use env::{cwd}; compiler/src/builtin_docs/env.hy Returns the current working directory as an absolute path.
Returns Err(EnvError::Other) if it cannot be read (for example when it
was deleted). Needs no permission.
Returns#
Result<string, EnvError>
Examples#
use env::{cwd};
use tests::assert;
let dir = match cwd() {
Result::Ok(d) => d,
Result::Err(_) => "",
};
assert!(dir.len() > 0);
See also#
args: Returns the program’s command-line arguments, starting with the program name.var: Returns the value of the environment variablename.set_var: Sets the environment variablenametovaluefor this process.remove_var: Removes the environment variablenamefrom this process.set_cwd: Changes the current working directory of the whole process.exit: Ends the process at once with exit statuscode.exec: Runsprogramwith the argumentsargvand waits for it to finish.