std.env.working_directory=
Show source codeHide source code
fn pub working_directory=[T: ToString](directory: ref T) -> Result[Nil, Error] {
match inko_env_set_working_directory(directory.to_string) {
case { @tag = 1, @value = _ } -> Result.Ok(nil)
case { @tag = _, @value = err } -> {
Result.Error(Error.from_os_error(err as Int))
}
}
}
fn pub static working_directory=[T: ToString](directory: ref T) -> Result[Nil, Error]
Changes the current working directory to the given directory.
Examples
Changing the current working directory:
import std.env
env.working_directory = '..'