diff options
author | Liviu Ionescu <ilg@livius.net> | 2022-04-21 07:29:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 07:29:31 +0300 |
commit | c6547c5362f39dd07cd2e609f34c7f586a3b222d (patch) | |
tree | dfcd65762dc7172e28aec134b48fa2818cef7e79 /test | |
parent | 61fefe1959a8ab9e796f409346ff619c14036c81 (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); |