-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Description
- Version: v9.8.0
- Platform: Linux 3.16.0-5-amd64 SMP Debian 3.16.51-3+deb8u1 (2018-01-08) x86_64 GNU/Linux
- Subsystem: fs
test.js:
const fs = require('fs')
console.log('writing a tmp file')
fs.writeFileSync('/tmp/tmp-file', 'this-is-a-tmp-file')
console.log('create read stream')
const ifs = fs.createReadStream('/tmp/tmp-file')
ifs.on('error', (err) => console.log('ifs error', err))
ifs.on('close', () => console.log('ifs close'))
console.log('create write stream')
const ofs = fs.createWriteStream('/tmp/tmp-file-2')
ofs.on('error', (err) => console.log('ofs error', err))
ofs.on('close', () => console.log('ofs close'))
setTimeout(() => {
console.log('timeout')
ifs.destroy(new Error('ifs Timed out'))
ofs.destroy(new Error('ofs Timed out'))
}, 5000)Outputs:
$ node test.js
writing a tmp file
create read stream
create write stream
timeout
ifs close
ofs closeI guess this line should be
closeFsStream(this, cb, err);Metadata
Metadata
Assignees
Labels
No labels