如何从writeStream获取文件的名称?
这是我想要做的:
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(); });
那么我可以从stream对象中获取文件名吗? 一个说明的例子将是很好的,参考良好的教程/文档(包含例子)在可写入的stream。
这是fs.createWriteStream
和stream.path
您可以通过console.dir(stream)
来查找所有的属性