-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
The callback passed to WriteStream.close
function from the "fs" module is not called in certain situations (see below). The same applies to the ReadStream.
var fs = require('fs');
var a = fs.createWriteStream('/tmp/aaa');
a.close(console.log.bind(null, 'closed'));
// prints "closed"
a.close(console.log.bind(null, 'closed'));
// the "close" callback is not executed the second time
var fs = require('fs');
var a = fs.createWriteStream('/dev/full');
a.on('error', console.log.bind(null, 'error'));
a.write('a');
// prints "error"
a.close(console.log.bind(null, 'closed'));
// the "close" callback is not called after an error
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.