Skip to content

Commit

Permalink
Merge pull request #3065 from wasmerio/fix_add_special_folders_to_rea…
Browse files Browse the repository at this point in the history
…ddir

Added '.' and '..' special folder t WASI fd_readdir return (for #3033)
  • Loading branch information
syrusakbary authored Aug 3, 2022
2 parents 2ea62aa + fc6936d commit e2de53c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/wasi/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,10 @@ pub fn fd_readdir<M: MemorySize>(
(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
}
Expand Down

0 comments on commit e2de53c

Please sign in to comment.