unLzmaFile
解压.7z压缩包(iOS仅支持iOS8及以上系统,请至config.xml中确认deployment-target的值)
import { MFileManager } from "@yl/super-jssdk"
MFileManager.unLzmaFile(optional)
参数说明
| 参数 |
类型 |
必填 |
作用 |
| optional |
Object |
是 |
必填参数 |
optional
| 参数 |
类型 |
必填 |
作用 |
| srcPath |
string |
是 |
源文件的绝对路径 |
| dstPath |
string |
是 |
解压目标路径(绝对路径) |
返回说明
| 参数 |
类型 |
作用 |
| resolve() |
Function |
执行成功回调 |
| reject(err) |
Function |
接口出错,err为详细错误信息,是一个json对象,例如:{"errCode":-1,"errMsg":"出错啦"} |
代码示例
MFileManager.unLzmaFile({
srcPath: 'file:///storage/emulated/0/Android/data/com.mysoft.smartengineertest/test.7z',
dstPath: 'file:///storage/emulated/0/Android/data/com.mysoft.smartengineertest/'
}).then(() => {
console.log('复制成功');
}).catch(err => {
console.error(err);
})