1 var constants = require('constants');
2 var common = require('../common');
3 var assert = require('assert');
4 var fs = require('fs');
6 var caughtException = false;
8 // should throw ENOENT, not EBADF
9 // see https://github.com/joyent/node/pull/1228
10 fs.openSync('/path/to/file/that/does/not/exist', 'r');
13 assert.equal(e.code, 'ENOENT');
14 caughtException = true;
16 assert.ok(caughtException);
19 fs.open(__filename, 'r', function(err, fd) {
27 fs.open(__filename, 'rs', function(err, fd) {
34 process.on('exit', function() {