I'm using Godot 2.1 Stable (x64) on Windows. According to most sources of reference, here is how you'd begin to list the contents of a directory:
var directory = Directory.new()
assert(directory.open("res://") == OK)
if directory.list_dir_begin() == false:
print("Couldn't begin list.")
For me, directory.listdirbegin() always returns false, even when the directory can in fact be listed.
According to the current documentation, it should only "Return false if the stream could not be initialised."
It seems to me like this can only be explained by one of three options:
- The documentation is inaccurate (or I misunderstand it), and a return code of false does not indicate failure.
- Something buggy is happening on my specific deployment, because other people experience return codes of true.
- There is a bug affecting all 2.1 deployments, and everyone's return code is false even when the listing succeeds.
Can anyone confirm that they get a return code of true when calling Directory.listdirbegin() on Godot 2.1 Stable?
Or explain that the documentation doesn't mean what I think it means?