ENOENT: no such file or directory, lstat with # encoded in filename
See original GitHub issue#8928 actually resolved the issue #8907 I open couple days ago. However, when filenames contain an encoded #
character (%23
), current decoding process do not handled it.
Configuration:
- Web browser and its version: Electron 1.7.8
- Operating system and its version: Fedora 25
- PDF.js version: 1.9.617
Steps to reproduce the problem:
- Open a locale file with an
#
encoded characterfile:///home/njakob/Foo%20Bar/document%23.pdf
What went wrong?
- The error
ENOENT: no such file or directory, lstat
is raised.
Issue is related to the decodeURI
usage which ignore decoding of %23
.
Solution should also cover cases were the #
is inside the path such as file:///home/njakob/Foo%23/document.pdf
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How to resolve Nodejs: Error: ENOENT: no such file or directory
Your app is expecting to find a file at /home/embah/node/nodeapp/config/config.json but that file does not exist (which is what ENOENT ...
Read more >File system | Node.js v19.3.0 Documentation
Using fsPromises.rmdir() on a file (not a directory) results in the promise being rejected with an ENOENT error on Windows and an ENOTDIR...
Read more >How To Fix the “Enoent” Error? - Position Is Everything
The “enoent” can appear because of some missing files or usage of the relative path that can be solved by creating an expected...
Read more >File — Elixir v1.12.3 - HexDocs
Creates a symbolic link new to the file or directory existing . ... of the file name is not a directory; on some...
Read more >Does stat/lstat on nonexistent file cause a disk seek?
Somehow the OS needs the information, wether the file is there or not. Obviously it has to read in the folder list of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you try to decode any url that contains
%23
in it, usingdecodeURIComponent
then it will decode just fine. So I think this should solve the problem.Also note that you are using chrome extension, so
node_stream
was never used, because it is intended to use in node environment. I will suggest to create a node app that uses pdf.js and see if problem still persists.Edit: I would suggest to use
console.log
as much as you can to see if code really executing.Thank you so much for this information and also for your help.