Skip to content

Commit 0482ec4

Browse files
XeCycleMyles Borins
authored and
Myles Borins
committed
test: numeric flags to fs.open
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 41453b3 commit 0482ec4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
const constants = require('constants');
5+
const assert = require('assert');
6+
const fs = require('fs');
7+
const path = require('path');
8+
9+
common.refreshTmpDir();
10+
11+
// O_WRONLY without O_CREAT shall fail with ENOENT
12+
const pathNE = path.join(common.tmpDir, 'file-should-not-exist');
13+
assert.throws(
14+
() => fs.openSync(pathNE, constants.O_WRONLY),
15+
(e) => e.code === 'ENOENT'
16+
);

0 commit comments

Comments
 (0)