diff --git a/lib/wasi/src/syscalls/mod.rs b/lib/wasi/src/syscalls/mod.rs index 4d0c563a6f4..ac6dde904bc 100644 --- a/lib/wasi/src/syscalls/mod.rs +++ b/lib/wasi/src/syscalls/mod.rs @@ -1321,6 +1321,10 @@ pub fn fd_readdir( (entry.name.to_string(), stat.st_filetype, stat.st_ino) }), ); + // adding . and .. special folders + // TODO: inode + entry_vec.push((".".to_string(), __WASI_FILETYPE_DIRECTORY, 0)); + entry_vec.push(("..".to_string(), __WASI_FILETYPE_DIRECTORY, 0)); entry_vec.sort_by(|a, b| a.0.cmp(&b.0)); entry_vec }