You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- os.Open --
[d tmpfs/ d home/ d bin/ d var/ d etc/ d lib/ d tmp/ L lib64 d root/ d dev/ d usr/ d sys/ d proc/ - .dockerenv]
[]
[]
-- os.DirFS.Open --
[d tmpfs/ d home/ d bin/ d var/ d etc/ d lib/ d tmp/ L lib64 d root/ d dev/ d usr/ d sys/ d proc/ - .dockerenv]
[]
[]
What did you expect to see?
-- os.Open --
[d tmpfs/ d home/ d bin/ d var/ d etc/ d lib/ d tmp/ L lib64 d root/ d dev/ d usr/ d sys/ d proc/ - .dockerenv]
[]
[]
-- os.DirFS.Open --
[d tmpfs/ d home/ d bin/ d var/ d etc/ d lib/ d tmp/ L lib64 d root/ d dev/ d usr/ d sys/ d proc/ - .dockerenv]
[d tmpfs/ d home/ d bin/ d var/ d etc/ d lib/ d tmp/ L lib64 d root/ d dev/ d usr/ d sys/ d proc/ - .dockerenv]
[d tmpfs/ d home/ d bin/ d var/ d etc/ d lib/ d tmp/ L lib64 d root/ d dev/ d usr/ d sys/ d proc/ - .dockerenv]
// If n <= 0, ReadDir returns all the DirEntry values from the directory
// in a single slice. In this case, if ReadDir succeeds (reads all the way
// to the end of the directory), it returns the slice and a nil error.
// If it encounters an error before the end of the directory,
// ReadDir returns the DirEntry list read until that point and a non-nil error.
so ReadDir should return all the entries whatever the internal offset is, shouldn't it?
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
os: DirFS's entry doesn't follow fs.ReadDirFile
os: document that fs.ReadDirFile.ReadDir doesn't restart each time
Sep 6, 2024
Go version
go version go1.22.6 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Run this program
What did you see happen?
I could reproduce the issue on my local macOS machine and the playground.
On the playground (https://go.dev/play/p/tBUins57hF-),
What did you expect to see?
os.File
'sReadDir
works as expected.On the other hand, the document for fs.ReadDirFile says
so
ReadDir
should return all the entries whatever the internal offset is, shouldn't it?The text was updated successfully, but these errors were encountered: