将.xip文件解压缩到特定文件夹中 [英] Extract .xip files into a specific folder
问题描述
XIP 文件是zip的模拟,但允许在扩展归档之前在接收系统上应用和验证数字签名.当打开 XIP 文件(通过双击)时,Archive Utility会自动将其展开(但前提是数字签名完好无损).
A XIP file is an analog to zip, but allows for a digital signature to be applied and verified on the receiving system, before the archive is expanded. When a XIP file is opened (by double-clicking), Archive Utility will automatically expand it (but only if the digital signature is intact).
本质上,.xip文件只是带有签名的.zip文件,用于验证自文件创建者保存文件以来该文件没有更改.这样既可以防止磁盘错误损坏,也可以防止第三方篡改文件.
Essentially, a .xip file is just a .zip with a signature to verify that the file has not changed since its creator saved it. This protects from both damage from a disk error and from a third-party tampering with the file.
有人知道如何提取此文件,例如使用终端到特定文件夹,而不是.xip文件所在的文件夹?
Does anyone know, how to extract this file, e.g. using Terminal, to a specific folder instead of to the folder where the .xip file resides?
推荐答案
也许尝试:
xip -x [path to .xip file]
这会将压缩文件解压缩到您当前的工作目录中.
That will unpack the archive into your current working directory.
对于提取到特定目录中,没有明确的选项,但是xip -x
将提取到当前工作目录中.因此,cd
到您要提取文件的位置应该可以;如果您特别需要自动执行此操作,请使用以下脚本:
As for extracting into a specific directory, there is not explicitly an option for this, but xip -x
will extract into the current working directory. Therefore, cd
ing to where you would like to extract the file should work; if you specifically need to automate this, a script to the effect of:
#!/bin/sh
xipfile="$(cd $(dirname "$1"); pwd -P)/$(basename "$1")" # a portable "realpath"
cd "$2"
xip -x "$xipfile"
我想怎么做?
这篇关于将.xip文件解压缩到特定文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!