0
압축을 풉니 다.NodeJs 내가 약 2 레벨 우편을 압축 해제해야합니다 스트림
[email protected]:/tmp$ file /var/logs-storage/wcm/119/2017-11-01-119-TcVXBh5RPEHTm86y7sOvJc7TjyQcAc6bqZVawcniIPwyJpWlYqCBJ2XNqBj1ikVF.zip
/var/logs-storage/wcm/119/2017-11-01-119-TcVXBh5RPEHTm86y7sOvJc7TjyQcAc6bqZVawcniIPwyJpWlYqCBJ2XNqBj1ikVF.zip: Zip archive data, at least v4.5 to extract
[email protected]:/tmp$ unzip -t /var/logs-storage/wcm/119/2017-11-01-119-TcVXBh5RPEHTm86y7sOvJc7TjyQcAc6bqZVawcniIPwyJpWlYqCBJ2XNqBj1ikVF.zip
Archive: /var/logs-storage/wcm/119/2017-11-01-119-TcVXBh5RPEHTm86y7sOvJc7TjyQcAc6bqZVawcniIPwyJpWlYqCBJ2XNqBj1ikVF.zip
testing: datamining_119_20171101_clickevent.zip OK
testing: datamining_119_20171101_impressionvisibility.zip OK
testing: datamining_119_20171101_conversion.zip OK
No errors detected in compressed data of /var/logs-storage/wcm/119/2017-11-01-119-TcVXBh5RPEHTm86y7sOvJc7TjyQcAc6bqZVawcniIPwyJpWlYqCBJ2XNqBj1ikVF.zip.
이 코드입니다 :
이
은 우편에 대한 정보입니다fs.createReadStream(source)
.pipe(unzipper.Parse())
.on('entry', (entry) =>
{
if (found || stop)
{
entry.autodrain();
return;
}
var filePath = entry.path;
var type = entry.type; // 'Directory' or 'File'
//var size = entry.size; // might be undefined in some archives
log.info(getMessage(ID, util.format("Entry: %s", filePath)));
var outPath = path.join(target, filePath);
if (
filePath.match(
new RegExp(
util.format(
"datamining_\d+_\d+_%s.*\.zip",
type
)
)
)
) {
var outStream = fs.createWriteStream(outPath);
entry.pipe(outStream);
found = true;
procLogStream.write(util.format(
"%s Found: %s\r\n",
utils.getCurrentDate(),
filePath
));
outStream.on('finish',() =>
{
if (!stop)
{
cb();
//tmpdir.removeCallback();
console.log('out stream finish');
}
stop = true;
}).on('error', (err) =>
{
if (!stop)
{
cb(err);
//tmpdir.removeCallback();
console.log('out stream error');
}
stop = true;
});
} else {
entry.autodrain();
}
})
.on('error', (err) =>
{
console.log('zip stream error');
console.log(err);
if (!found && !stop) {
cb(err);
//tmpdir.removeCallback();
}
stop = true;
})
.on('finish',() =>
{
console.log('zip stream finish');
if (!found && !stop) {
cb();
//tmpdir.removeCallback();
}
stop = true;
});
그리고 이러한 오류입니다 : 내가 어떤 실제로 것이다 라이브러리에 대한 많은 검색
info: [utils/worker.js] 5a27a822cb569b2db8bc493d: Entry: datamining_119_20171101_clickevent.zip
zip stream error
Error: invalid signature: 0x83268e0
at /home/apshenichnikov/NetBeansProjects/lps/node_modules/unzip/lib/parse.js:59:13
at runCallback (timers.js:666:20)
at tryOnImmediate (timers.js:639:5)
at processImmediate [as _immediateCallback] (timers.js:611:5)
error: [utils/worker.js] 5a27a822cb569b2db8bc493d Error: invalid signature: 0x83268e0
error: [utils/worker.js] 5a27a822cb569b2db8bc493d: errored
zip stream error
{ Error: unexpected end of file
at Zlib._handle.onerror (zlib.js:370:17) errno: -5, code: 'Z_BUF_ERROR' }
일, 나무를 보았습니다 ...
No에 옵션이 없다고 느낍니다. deJs zip 파일을 처리하는 ...
당신은 내 믿음을 반증 할 수 있습니까?