c.on('ready', function () {
console.log('ready');
c.get('/pub/seg/pac/chkrootkit.tar.gz',function(err,stream){
if(err){
console.log("error");
}else{
stream.once("close",function(){
c.end();
});
var writable = fs.createWriteStream('chkrootkit.tar.gz','a');
stream.pipe(writable);
}
});
});
这段代码一开始运行成功了,但是我把对应文件删除后重新下载的话又会报错:
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: EACCES, open 'chkrootkit.tar.gz'
新人求指导