diff options
author | Liviu Ionescu <ilg@livius.net> | 2022-04-21 07:29:31 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2022-04-28 07:56:14 +0300 |
commit | 1976284a92c661b9578828ed8c412fef8e6587bb (patch) | |
tree | 1c8604a6b2b98fc5fe84498d04c65fce1c9bd8c7 /test | |
parent | 5d15eb1a1491aee17e9d347c4376060eacb2ccb7 (diff) |
src: define fs.constants.S_IWUSR & S_IRUSR for Win
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.
fixes: https://github.com/nodejs/node/issues/41591
PR-URL: https://github.com/nodejs/node/pull/42757
Refs: https://github.com/nodejs/node/issues/41591
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-fs-constants.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-fs-constants.js b/test/parallel/test-fs-constants.js new file mode 100644 index 00000000000..49bcabd8087 --- /dev/null +++ b/test/parallel/test-fs-constants.js @@ -0,0 +1,8 @@ +'use strict'; +require('../common'); +const fs = require('fs'); +const assert = require('assert'); + +// Check if the two constants accepted by chmod() on Windows are defined. +assert.notStrictEqual(fs.constants.S_IRUSR, undefined); +assert.notStrictEqual(fs.constants.S_IWUSR, undefined); |