-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Directory listing returns incorrect contents for /tmp #28015
Comments
The test is broken by dart-lang/sdk#28015.
The test is broken by dart-lang/sdk#28015.
This is verified on my Linux machine as well. By moving files around to different directories, and listing using Dart, I have found that the directory list seems to get truncated when it gets to the file I think the C++ native code implementing directory listing for Dart can't handle receiving an entry which isn't the normal file, directory, or symbolic link type, and fails. This failure is turning into an end-of-stream, rather than an error. If the file type isn't Link, File, or Dir, the code just falls through to line 196, and returns kListDone. This just needs to be fixed by covering the other cases of sockets, pipes, devices, etc from https://www.gnu.org/software/libc/manual/html_node/Directory-Entries.html |
Should the entries that are not regular files be skipped or listed? I would say listed, but I'm not 100% sure that this is consistent with the API docs (which say only "files", "directories", and "links" are listed), so I will punt to @floitschG for confirmation. |
I'd expect them to be listed as |
As I said, I would expect so as well, but I'm not going to land a change without the owner of the API weighing in here. |
I think Lasse is the library api owner. |
The following program:
prints this output for me:
I have many more than two entries in my
/tmp
directory, and I'd expect to see all of them when I list the directory.I've reproduced this on 1.21.0-dev.9.0 and on stable versions as far back as 1.16.0. I'm using Ubuntu 14.04 LTS.
The text was updated successfully, but these errors were encountered: