mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +00:00
os: implement readdir for darwin and linux
readdir is disabled on linux for 386 and arm until syscall.seek is implemented there. windows is hard, so leaving that for later. File src/os/dir_other_go115.go can be deleted when we drop support for go 1.15. Also adds TestReadNonDir, which was helpful while debugging.
This commit is contained in:
@@ -8,19 +8,10 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
DirEntry = fs.DirEntry
|
||||
FileMode = fs.FileMode
|
||||
FileInfo = fs.FileInfo
|
||||
)
|
||||
|
||||
func (f *File) ReadDir(n int) ([]DirEntry, error) {
|
||||
return nil, &PathError{"ReadDir", f.name, ErrNotImplemented}
|
||||
}
|
||||
|
||||
func ReadDir(name string) ([]DirEntry, error) {
|
||||
return nil, &PathError{"ReadDir", name, ErrNotImplemented}
|
||||
}
|
||||
|
||||
// The followings are copied from Go 1.16 official implementation:
|
||||
// https://github.com/golang/go/blob/go1.16/src/os/file.go
|
||||
|
||||
|
||||
Reference in New Issue
Block a user