We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d08844c commit a010fbeCopy full SHA for a010fbe
crates/wasi-common/src/snapshots/preview_1.rs
@@ -814,6 +814,13 @@ impl wasi_snapshot_preview1::WasiSnapshotPreview1 for WasiCtx {
814
drop(dir_entry);
815
816
let fd = match file {
817
+ // Paper over a divergence between Windows and POSIX, where
818
+ // POSIX returns EISDIR if you open a directory with the
819
+ // WRITE flag: https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html#:~:text=EISDIR
820
+ #[cfg(windows)]
821
+ OpenResult::Dir(_) if write => {
822
+ return Err(types::Errno::Isdir.into());
823
+ }
824
OpenResult::File(file) => table.push(Arc::new(FileEntry::new(file, access_mode)))?,
825
OpenResult::Dir(child_dir) => table.push(Arc::new(DirEntry::new(None, child_dir)))?,
826
};
0 commit comments