Two files seem to be ignored and instead the "./" and "../" paths are shown. I'm having this issue on Linux. The code that's running in the screen recording simply logs all the files returned.
local files = playdate.file.listFiles("files")
for i = 1, #files do
print(files[i])
end
playdate.update = function() end
I could't reproduce this when I tested it with the above sample code. What distro are you using? In the original post it looks like Elementary; I tested it on Fedora 35. I'll look at it again today on EOS.
I'm on Ubuntu 21.10.
By any chance, is the code relying on the output of readdir being sorted? It is not.
For example, readdir in the directory that made me aware of this bug gives me the files in this order:
The issue is, in fact, on macOS readdir() returns . and .. as the first results while on Ubuntu (and not Fedora??) it is unordered. I am fixing this now. Thanks for the follow-up!
Yeah, order is not guaranteed by the POSIX standard, and the Linux manpage warns about it:
The order in which filenames are read by successive calls to readdir() depends on the filesystem implementation; it is unlikely that the names will be sorted in any fashion.