use std::fs::create_dir_all;
use std::path::Path;
use std::{env, fs};
fn main() {
let p = env::current_dir();
println!("当前主目录:{:?}", p.expect("REASON").display());
println!("当前主目录:{:?}", std::env::current_dir().unwrap());
println!("当前EXE路径包含exe:{:?}", std::env::current_exe().unwrap());
let exe = std::env::current_exe().unwrap();
let dir = exe.parent().expect("Executable must be in some directory");
println!("当前EXE路径:{:?}", dir);
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询