以下是我的要求:
stream = fs.WriteStream('crap.txt',{flags:'w'};
// more code
response.on('close',function() {
// is the below line possible?
fs.stat(stream.name, function(stats) {
console.log(stats.size);
});
stream.end();
});
我能从流对象中获取文件名吗?最好提供一个图例示例,并参考一些包含可写流示例的好教程/文档。