I'm writing a command-line tool using Rust. I want to cd
to the wanted dictionary when I execute my Rust command-line tool.
I use env::set_current_dir(path)
, but it does not work. After that, I use nix
, call nix::unistd::chdir(path)
, but it does not work either.
So how can I archieve the goal of chaging command dictionary? How to make cd
call in Rust.