need DirExt::hard_link_nofollow to implement path_link properly

This commit is contained in:
Pat Hickey
2021-01-11 15:47:57 -08:00
parent 09861c20db
commit 932ba6b4f3
2 changed files with 13 additions and 2 deletions

View File

@@ -15,7 +15,8 @@ wasi_tests::path_filestat
- fdstat.fs_flags is not populated correctly - APPEND | SYNC aren't
present because File::get_fdflags isnt implemented correctly
wasi_tests::path_link
- symlink following behavior not yet implemented
- need DirExt::hard_link_nofollow
wasi_tests::path_rename_trailing_slashes
- unclear, trailing slash behavior is wrong
wasi_tests::path_symlink_trailing_slashes

View File

@@ -405,7 +405,17 @@ impl WasiDir for cap_std::fs::Dir {
.as_any()
.downcast_ref::<Self>()
.ok_or(Error::NotCapable)?;
self.hard_link(Path::new(src_path), target_dir, Path::new(target_path))?;
let src_path = Path::new(src_path);
let target_path = Path::new(target_path);
if symlink_follow {
self.hard_link(src_path, target_dir, target_path)?;
} else {
todo!()
/*
use cap_fs_ext::DirExt;
self.hard_link_nofollow(src_path, target_dir, target_path)?;
*/
}
Ok(())
}
fn set_times(