We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#!/usr/bin/env rust-script // Layout: // /home/kellytk/symlinkedscript/ // /home/kellytk/symlinkedscript/script/script.rs - this file. // /home/kellytk/symlinkedscript/symlink/script.rs - symlink (ln -s /home/kellytk/symlinkedscript/script/script.rs /home/kellytk/symlinkedscript/symlink/script.rs) let path = std::env::var("RUST_SCRIPT_BASE_PATH").expect("fetch failure"); println!( "RUST_SCRIPT_BASE_PATH: {:?}", path, ); println!("canonicalized path: {:?}", std::fs::canonicalize(path).expect("canonicalize failure")); /* $ pwd /home/kellytk/symlinkedscript As expected: $ ./script/script.rs RUST_SCRIPT_BASE_PATH: "/home/kellytk/symlinkedscript/./script" canonicalized path: "/home/kellytk/symlinkedscript/script" Unexpected: $ ./symlink/script.rs RUST_SCRIPT_BASE_PATH: "/home/kellytk/symlinkedscript/./symlink" canonicalized path: "/home/kellytk/symlinkedscript/symlink" Expected: $ ./symlink/script.rs RUST_SCRIPT_BASE_PATH: "/home/kellytk/symlinkedscript/./script" canonicalized path: "/home/kellytk/symlinkedscript/script" */
How please can the expected result be obtained in both cases?
The text was updated successfully, but these errors were encountered:
-Zscript
current_exe
No branches or pull requests
How please can the expected result be obtained in both cases?
The text was updated successfully, but these errors were encountered: