-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Can't open hidden files in 'w' mode on Windows - document, fix, or do nothing? #14553
Comments
I'm not 100% sure but reading |
It doesn't enforce it explicitly, no. It just never passes the |
I don't know if that is fixable. Passing it by default is not an option and retrying the CreateFile() call on error is race-y. All signs seem to point to 'documentation fix.' |
It seems like the only way to write to hidden files (without setting |
Hm, does that mean |
Why not?
No, 'wx' maps to |
But won't this cause new files to be hidden? |
Indeed it does... 🤦♂️ |
So, what is the consensus here? Documentation fix? Any volunteers? |
Yes, it is. |
So the question at hand is whether we want to deviate from CRT here or not. If we do, this needs an upstream implementation, and I am not sure an atomic solution exists. |
PR-URL: #15409 Fixes: #14553 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: nodejs/node#15409 Fixes: nodejs/node#14553 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: nodejs/node#15409 Fixes: nodejs/node#14553 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Trying to open a hidden file on Windows in 'w' mode throws
EPERM
:This matches the behavior of Microsoft C runtime library:
Output if "hidden.txt" is hidden:
And it matches the behavior of Python since it purportedly uses
_wfopen
under the hood:However, this behavior has caused at least two issues down the road:
So, my questions are:
The text was updated successfully, but these errors were encountered: