Lines Matching defs:fs
26 const fs = require('fs');
34 const stream = fs.WriteStream(file);
35 const _fs_close = fs.close;
36 const _fs_open = fs.open;
38 // Change the fs.open with an identical function after the WriteStream
40 // returned. This simulates AOP-style extension of the fs lib.
41 fs.open = function() {
42 return _fs_open.apply(fs, arguments);
45 fs.close = function(fd) {
46 assert.ok(fd, 'fs.close must not be called with an undefined fd.');
47 fs.close = _fs_close;
48 fs.open = _fs_open;
49 fs.closeSync(fd);
56 assert.strictEqual(fs.open, _fs_open);