These are chat archives for rust-lang/rust

Jul 2015
Andy Russell
Jul 27 2015 04:40
I have a function that I need to pass a path to a folder into, but a relative path doesn't work because the crate I'm working on is a library. How can I get an absolute path to a folder inside the library crate?
I guess I need something akin to os.path.realpath(__file__) from Python
Andy Russell
Jul 27 2015 04:46
Or probably a way to get the crate root directory would be better
Andy Russell
Jul 27 2015 04:52
Ah, whoops. Seems like file!() does what I want. Still interested if there's a cleaner way though?
Peter Atashian
Jul 27 2015 10:17
@euclio There is an unstable canonicalize method which will return the full canonical path to a given valid file/directory.