ax_std/env.rs
1//! Inspection and manipulation of the process’s environment.
2
3#[cfg(feature = "fs")]
4extern crate alloc;
5
6#[cfg(feature = "fs")]
7use {crate::StdResult, alloc::string::String};
8
9/// Returns the current working directory as a [`String`].
10#[cfg(feature = "fs")]
11pub fn current_dir() -> StdResult<String> {
12 Ok(ax_api::fs::ax_current_dir()?)
13}
14
15/// Changes the current working directory to the specified path.
16#[cfg(feature = "fs")]
17pub fn set_current_dir(path: &str) -> StdResult {
18 ax_api::fs::ax_set_current_dir(path)?;
19 Ok(())
20}