Skip to content

wasi: implement readdir #3087

@codefromthecrypt

Description

@codefromthecrypt

Until readdir is implemented in wasm, we can't re-use go's utilities for testing for bugs in impl.

2022/01/01 00:00:00 TestFS err: TestFS found errors:
        .: ReadDir(-1): readdir unimplemented : errno 54

Here's what would be nice to be able to both compile and run (right now, it compiles but can't run).

package main

import (
	"fmt"
	"log"
	"os"
	"syscall"
	"testing/fstest"
)

func main() {
	if err := fstest.TestFS(os.DirFS("sub"), "test.txt"); err != nil {
		log.Panicln("TestFS err:", err)
	}
	fmt.Println("TestFS ok")
}

Maybe implementing needs a change here

func ReadDirent(fd int, buf []byte) (n int, err error) {
return -1, ENOSYS
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwasmWebAssembly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions