2015-11-03 09:52:46 +08:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
const assert = require('assert');
|
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
common.refreshTmpDir();
|
|
|
|
|
|
|
|
// O_WRONLY without O_CREAT shall fail with ENOENT
|
|
|
|
const pathNE = path.join(common.tmpDir, 'file-should-not-exist');
|
|
|
|
assert.throws(
|
2016-05-02 10:27:12 -07:00
|
|
|
() => fs.openSync(pathNE, fs.constants.O_WRONLY),
|
2015-11-03 09:52:46 +08:00
|
|
|
(e) => e.code === 'ENOENT'
|
|
|
|
);
|