src: expose Windows-only fs open flags · nodejs/node@ad35fe9 · GitHub
Skip to content

Commit ad35fe9

Browse files
PickBasaduh95
authored andcommitted
src: expose Windows-only fs open flags
Signed-off-by: Kirill Saied <sayed.kirill@gmail.com> PR-URL: #64775 Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 8657497 commit ad35fe9

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

doc/api/fs.md

Lines changed: 27 additions & 1 deletion

src/node_constants.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,12 @@ void DefineFsConstants(Local<Object> target) {
11371137
NODE_DEFINE_CONSTANT(target, O_EXCL);
11381138
#endif
11391139

1140-
NODE_DEFINE_CONSTANT(target, UV_FS_O_FILEMAP);
1140+
// Windows-only open flags honored by libuv. They are 0 on other platforms.
1141+
NODE_DEFINE_CONSTANT(target, UV_FS_O_FILEMAP);
1142+
NODE_DEFINE_CONSTANT(target, UV_FS_O_TEMPORARY);
1143+
NODE_DEFINE_CONSTANT(target, UV_FS_O_SHORT_LIVED);
1144+
NODE_DEFINE_CONSTANT(target, UV_FS_O_SEQUENTIAL);
1145+
NODE_DEFINE_CONSTANT(target, UV_FS_O_RANDOM);
11411146

11421147
#ifdef O_NOCTTY
11431148
NODE_DEFINE_CONSTANT(target, O_NOCTTY);

test/parallel/test-fs-constants.js

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)