bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
4.84k stars 618 forks source link

Read directory bug ? #2889

Open Userzxcvbvnm opened 10 months ago

Userzxcvbvnm commented 10 months ago

Steps to reproduce

There is a file Data/mydir/test.txt is in the path Data/mydir. The test program is to print the files in the path Data/mydir.

The c file is uploaded as readdir-c.txt

The wasm file is uploaded as readdir-wasm.txt

Expected behavior

Print:

Successfully get the file fd.
.
..
test.txt

wasmer wasmtime wazero print the above message.

Actual behavior

WAMR prints:

Successfully get the file fd.
opendir.

WAMR print the content of Data/mydir fails.

Envrionment

Windows 10 (amd64) WAMR-1.2.3

yamt commented 9 months ago

on macOS, it worked as expected. maybe something specific to windows?

wenyongh commented 9 months ago

Windows uses libc-uvwasi by default, the result may be different.