I’m trying to write a small routine too create a new directory if it does not exists.
The code should be able to operate on relative directories as I want it to default to “~/” if no other base path has been set.
Looking at the docs for std::fs or std::path it seems that there is not way to expand “~/” to its absolute path. The closes there is seems to be https://doc.rust-lang.org/nightly/std/path/struct.Path.html#method.canonicalize but it does not work on paths that does not exists (which is my starting problem).
Any pointers for how to work with relative paths in rust?