This commit is contained in:
Pat Hickey
2020-12-18 11:33:28 -08:00
parent f6afd4c41c
commit 82edae32b7
2 changed files with 24 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ pub trait WasiDir {
fn symlink(&self, old_path: &str, new_path: &str) -> Result<(), Error>;
fn remove_dir(&self, path: &str) -> Result<(), Error>;
fn unlink_file(&self, path: &str) -> Result<(), Error>;
fn read_link(&self, path: &str) -> Result<PathBuf, Error>;
}
pub(crate) struct DirEntry {
@@ -304,4 +305,8 @@ impl WasiDir for cap_std::fs::Dir {
self.remove_file(Path::new(path))?;
Ok(())
}
fn read_link(&self, path: &str) -> Result<PathBuf, Error> {
let link = self.read_link(Path::new(path))?;
Ok(link)
}
}