Uh oh!
There was an error while loading. Please reload this page.
src: define S_IWUSR & S_IRUSR for Windows - #42748
Conversation
On Windows, most of the POSIX file mode definitions are not available. However, functionally equivalent read/write definitions exists, and `chmod()` can use them. This patch defines two aliases, so that these definintions are issued in `fs.constants`. #41591
tniessen
commented
Apr 15, 2022
cc @nodejs/platform-windows @nodejs/libuv |
ilg-ul
commented
Apr 15, 2022
Please note that I do not have a Windows build environment available, and I could not check if this patch added the two definitions to fs.constants; this probably should be added to the tests, but I don't know how to do it. |
On Windows, most of the POSIX file mode definitions are not available. However, functionally equivalent read/write definitions exists, and `chmod()` can use them. This patch defines two aliases, so that these definintions are issued in `fs.constants`. #41591
On Windows, most of the POSIX file mode definitions are not available. However, functionally equivalent read/write definitions exists, and `chmod()` can use them. This patch defines two aliases, so that these definintions are issued in `fs.constants`. refs: #41591
| assert.ok(fs.constants.S_IRUSR !== undefined); | ||
| assert.ok(fs.constants.S_IWUSR !== undefined); |
There was a problem hiding this comment.
It'd be better to use assert.notStrictEqual() here. The "is windows?" guard is better written as:
if(!common.isWindows)common.skip('Windows-only test');Although in its current incarnation it's not really Windows-specific. You could just remove the guard altogether and rename the file.
RaisinTen
left a comment
There was a problem hiding this comment.
LGTM but could you please get rid of the merge commits? It negatively affects our tooling.
ilg-ul
commented
Apr 16, 2022
Oops! I thought it is something wrong :-( I'm using VS Code -> Amend. I should have used plain commit, right? |
If the mess creates any problems, we can abandon this PR and I can try to create a new one, hopefully cleaner. |
ilg-ul
commented
Apr 16, 2022
Any idea how I managed to break the ASan test? |
bnoordhuis
commented
Apr 16, 2022
That looks like a flaky test, not anything caused by this PR. Apropos merge commits: |
ilg-ul
commented
Apr 16, 2022
Recreated as #42757. |
On Windows, most of the POSIX file mode definitions are not available.
However, functionally equivalent read/write definitions exists, and
chmod()can use them. This patch defines two aliases, so that thesedefinintions are issued in
fs.constants.Fixes: #41591