-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deno.readDir won't return all files #12998
Comments
You didn't link to a specific line – I'm assuming you mean Line 1176 in d313787
I've done some work on puzzling out the web-exposed filenames that you get from file controls, at w3c/FileAPI#161. Of course, this gets a lot more complicated with file system access APIs. Is this something we want? |
Yeah. Github's "Copy permalink" doesn't copy line numbers it seems 😔 I think the behavior we want is whatever Node does here. So either replace the invalid chars with replacement chars, or use WTF-16 encoding. |
Looks like this is a long standing issue: #627 Sounds like one possible solution would be a Deno equilivant |
Hi @Sembiance @lucacasonato I would like to take a shot at this. Do we have a public list of replacement chars to use? I'd like to try the "replace invalid chars" approach. EDIT: I noticed Nemo, my (Linux) file manager shows Do I replace all invalid chars with this char instead? |
Hi @shanmukhateja, and thank you for your interest, but unfortunately this isn't a simple issue of replacing characters from the JS side. The code that deals with interacting with the filesystem is Rust code, including the code that skips files with invalid filenames here. And changing it to not skip them would already be enough to replace those invalid bytes or code units with the replacement character. But making this change would have further effects on the Deno ecosystem, because some of the files returned by |
If a filename has funny characters
Deno.readDir
will silently ignore those files.First unzip bug.tar.zip which produces
bug.tar
fileNow untar
bug.tar
which producesbug
directoryNow run
deno run --allow-read readDirBug.js
:It only shows 2 entries, should be 4.
NodeJS finds these files just fine:
System info:
EDIT: Added attachment, bug.tar.zip
The text was updated successfully, but these errors were encountered: