Skip to content

os: ReadDir on non-directory doesn't return error on Plan 9 #75196

@millerresearch

Description

@millerresearch

CL 699375 fixed a similar issue for Windows, and added a test to TestReadDir which fails on plan9-arm, revealing that Plan 9 has the same problem.

--- FAIL: TestReadDir (0.05s)
    read_test.go:119: ReadDir /tmp/TestReadDir1843189195/001/foo: (nil, ENOTDIR) expected, got ([], <nil>)
FAIL
FAIL	os	80.191s

Plan 9 makes less distinction than other operating systems between directories and regular files, so the ReadDir implementation needs to make an explicit check that its argument is a directory and return ENOTDIR otherwise.

Metadata

Metadata

Labels

BugReportIssues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.OS-Plan9

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions