【发布时间】:2013-04-16 00:09:32
【问题描述】:
这是我想做的:
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();
});
那么我可以从流对象中获取文件名吗?一个有插图的例子会很好,参考关于可写流的优秀教程/文档(包含示例)。
【问题讨论】:
-
不是答案,但writeStream.bytesWritten 存在。
标签: javascript node.js stream