Here is what I want to do:
以下是我想做的:
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();
});
So can I get the filename from the stream object? An illustrated example would be nice, with reference to good tutorial/docs (containing examples) on writable streams.
那么我可以从流对象中获取文件名吗?举例说明就可以了,可以参考可写流上好的教程/文档(包含示例)。
1 个解决方案
#1
4
It's fs.createWriteStream
and stream.path
fs。createWriteStream和stream.path
You can console.dir(stream)
to find all it's properties
您可以通过console.dir(流)来查找所有的属性。
#1
4
It's fs.createWriteStream
and stream.path
fs。createWriteStream和stream.path
You can console.dir(stream)
to find all it's properties
您可以通过console.dir(流)来查找所有的属性。