如何在Linux中以编程方式获取给定相对路径的绝对路径?
我们有Windows的Windows _fullpath().换句话说,我的意思是_fullpathLinux中Windows的类似API是什么?
我想检查一个路径是否是另一个路径的子目录:
use std::path::Path;
let path = Path::new("/foo/bar/");
let child = Path::new("/foo/bar/baz");
assert_eq!(is_subdirectory(path, child), true);
Run Code Online (Sandbox Code Playgroud)
这个怎么做?