new cap-std apis fix some windows tests!
fix for fd_readdir test on linux, and symlink_create / nofollow_errors
This commit is contained in:
@@ -194,13 +194,9 @@ mod wasi_tests {
|
|||||||
[
|
[
|
||||||
// Panic: Metadata not associated with open file
|
// Panic: Metadata not associated with open file
|
||||||
// https://github.com/bytecodealliance/cap-std/issues/142
|
// https://github.com/bytecodealliance/cap-std/issues/142
|
||||||
"fd_readdir",
|
|
||||||
"fd_flags_set",
|
"fd_flags_set",
|
||||||
"path_filestat",
|
"path_filestat",
|
||||||
"symlink_filestat",
|
"symlink_filestat",
|
||||||
// upstream fixes pending:
|
|
||||||
"symlink_create", // cap-std #149
|
|
||||||
"nofollow_errors", // cap-std #149 and #150
|
|
||||||
// Trailing slash related bugs
|
// Trailing slash related bugs
|
||||||
"interesting_paths",
|
"interesting_paths",
|
||||||
"path_rename_file_trailing_slashes",
|
"path_rename_file_trailing_slashes",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use crate::file::{filetype_from, File};
|
use crate::file::{filetype_from, File};
|
||||||
use cap_fs_ext::{DirExt, MetadataExt, SystemTimeSpec};
|
use cap_fs_ext::{DirEntryExt, DirExt, MetadataExt, SystemTimeSpec};
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
@@ -123,7 +123,7 @@ impl WasiDir for Dir {
|
|||||||
// Now process the `DirEntry`s:
|
// Now process the `DirEntry`s:
|
||||||
self.0.entries()?.map(|entry| {
|
self.0.entries()?.map(|entry| {
|
||||||
let entry = entry?;
|
let entry = entry?;
|
||||||
let meta = entry.metadata()?;
|
let meta = entry.full_metadata()?;
|
||||||
let inode = meta.ino();
|
let inode = meta.ino();
|
||||||
let filetype = filetype_from(&meta.file_type());
|
let filetype = filetype_from(&meta.file_type());
|
||||||
let name = entry
|
let name = entry
|
||||||
@@ -163,7 +163,7 @@ impl WasiDir for Dir {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn unlink_file(&self, path: &str) -> Result<(), Error> {
|
fn unlink_file(&self, path: &str) -> Result<(), Error> {
|
||||||
self.0.remove_file(Path::new(path))?;
|
self.0.remove_file_or_symlink(Path::new(path))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
fn read_link(&self, path: &str) -> Result<PathBuf, Error> {
|
fn read_link(&self, path: &str) -> Result<PathBuf, Error> {
|
||||||
|
|||||||
Reference in New Issue
Block a user