Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

fs.lstatSync fails for some filenames returned by fs.readdirSync #9203

Closed
dronus opened this issue Feb 12, 2015 · 1 comment
Closed

fs.lstatSync fails for some filenames returned by fs.readdirSync #9203

dronus opened this issue Feb 12, 2015 · 1 comment
Labels

Comments

@dronus
Copy link

dronus commented Feb 12, 2015

For some akward directory names, like "Esbj�rn Svensson Trio - EST Plays Monk", which in this case are a result of bad encoding, but are valid file names for Linux systems, fs.lstatSync fails with ENOENT.

These filenames can however be returned by fs.readdirSync.

I thought fs.lstatSync should work on any name returned by fs.readdirSync (except race conditions by simultanous fs manipulation).

@dronus
Copy link
Author

dronus commented Feb 12, 2015

The filename example above is not verbatim, as it can not be pasted here as such. It consists a byte value above 127, which is not followed someting forming a valid UTF8 code group. Such filenames may be obtained by copying Latin1 encoded filenames to an UTF8 system.

@jasnell jasnell added the fs label Jun 25, 2015
@Trott Trott closed this as completed Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants