-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
rmSync does not throw error if file exists but cannot be deleted. #38683
Comments
I think I've found the issue, I'll take a look |
fix rmsync swallowing errors instead of throwing them. fixes: nodejs#38683
fix rmsync swallowing errors instead of throwing them. fixes: nodejs#38683
fix rmsync swallowing errors instead of throwing them. fixes: nodejs#38683 fixes: nodejs#34580
Hi, thank you for the fix. Any plan to backport to 16.x LTS? |
@babatakao I understand fixing this |
Fixing this issue kind of broke Node.js's build, so we assumed that others would probably face similar issues. |
I understand. Thanks! |
What steps will reproduce the bug?
fs.rmSync
does not error if file exists, but cannot be deleted because parent directory is readonly. The file remains, but no error is thrown. (Note thatfs.rm
works as expected.)I expect the following code to emit an EACCES error, but it does not:
However, this code does emit that error:
as does:
How often does it reproduce? Is there a required condition?
Always reproducible.
What is the expected behavior?
The file is not deleted, and the error is emitted:
What do you see instead?
The file is not deleted, but no error is emitted.
Additional information
The commands
mkdir tmp ; touch tmp/file ; chmod 500 tmp ; rm -f tmp/file
show the expected resultrm: tmp/file: Permission denied
and the file is not deleted.I believe Linux systems also exhibit this, but have not explicitly tested this minimal reproducible example on Linux.
The text was updated successfully, but these errors were encountered: