Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions test/parallel/test-fs-open-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ const assert = require('assert');
const fs = require('fs');
const path = require('path');

const O_APPEND = fs.constants.O_APPEND || 0;
const O_CREAT = fs.constants.O_CREAT || 0;
const O_EXCL = fs.constants.O_EXCL || 0;
const O_RDONLY = fs.constants.O_RDONLY || 0;
const O_RDWR = fs.constants.O_RDWR || 0;
const O_SYNC = fs.constants.O_SYNC || 0;
const O_DSYNC = fs.constants.O_DSYNC || 0;
const O_TRUNC = fs.constants.O_TRUNC || 0;
const O_WRONLY = fs.constants.O_WRONLY || 0;
// 0 if not found in fs.constants
const { O_APPEND = 0,
O_CREAT = 0,
O_EXCL = 0,
O_RDONLY = 0,
O_RDWR = 0,
O_SYNC = 0,
O_DSYNC = 0,
O_TRUNC = 0,
O_WRONLY = 0
} = fs.constants;

const { stringToFlags } = require('internal/fs/utils');

Expand Down
8 changes: 1 addition & 7 deletions test/parallel/test-fs-open-mode-mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ const assert = require('assert');
const path = require('path');
const fs = require('fs');

let mode;

if (common.isWindows) {
mode = 0o444;
} else {
mode = 0o644;
}
const mode = common.isWindows ? 0o444 : 0o644;

const maskToIgnore = 0o10000;

Expand Down