WebAssembly / wasi-filesystem

Filesystem API for WASI
Other
179 stars 18 forks source link

Add text and tests for a rule around "." and ".." entries in directory listings #90

Closed codefromthecrypt closed 1 year ago

codefromthecrypt commented 1 year ago

The recently added rust tests include tests that summarize as directory listings MUST return "." and ".." entires https://github.com/WebAssembly/wasi-testsuite/blob/main/tests/rust/src/bin/fd_readdir.rs#L150-L153

I think this should be backed by specification about why and also edge cases. For example, should a pre-open return ".." at any time? Should it return ".." if its pre-open name is "/"? What about if the pre-open name is ".."?

This is particularly of interest with virtual filesystems, which may not have a ".." notion at all. Meanwhile at least zig and go guests filter out "." and ".." from listings, but to synthetically produce ".." based on the above cases is not only extra state but also futile when they are discarded.

I understand this is a different topic vs the current interpretation of snapshot-01, so raising it here. However, whatever decision here doesn't really satisfy the issue I raised despite it being within your right to close it anyway https://github.com/WebAssembly/wasi-testsuite/issues/52