Closed hjyssg closed 1 year ago
module.exports.extractAll = async function (filePath, outputPath) {
if (!global._has_7zip_) {
throw "this computer did not install 7z"
}
const opt = ['x', filePath, `-o${outputPath}`, "-aos"];
// get7zipOption(filePath, outputPath);
let error, pathes
try {
const { stderr } = await execa(sevenZip, opt);
if (stderr) {
throw stderr;
}
// pathes = await pfs.readdir(outputPath);
const temp = await fileiterator(outputPath, {
doNotNeedInfo: true,
slient: true
});
pathes = temp.pathes;
} catch (e) {
error = e;
logger.error('[extractAll] exit: ', e);
} finally {
return { error, pathes }
}
}
if(!config.slient){
if (config.estimated_total) {
console.log("[file-iterator] scan:", currentLen, ` ${(currentLen / config.estimated_total * 100).toFixed(2)}%`);
} else {
console.log("[file-iterator] scan:", currentLen);
}
}
解压然后前端跳转按文件夹打开?
现在7zip是e,解压会互相overwrite
用x可以解决。但是需要改
还要改thumbnail现有代码