tar --use-compress-program 在 OSX 上损坏
tar --use-compress-program is broken on OSX
我通过自制软件在我的 Macbook Air (OS X 10.10.5) 上安装了 pigz 以获得更好的 compress/decompress.
性能
压缩,我用的是tar --use-compress-program=pigz -cf test.tgz test
,没问题。
但是命令解压,tar --use-compress-program=pigz -xf test.tgz
输出错误:
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
或者有时它输出:
tar: Unrecognized archive format
pigz: abort: write error on <stdout> (Broken pipe)
tar: Child process exited with status 32
tar: Error exit delayed from previous errors.
我读了 manual of tar,不知道为什么它不起作用。
我注意到甚至 tar --use-compress-program=gzip -xf test.tgz
也会产生同样的错误。那么这是 OSX 的 tar 实现的错误吗?
注意:我知道管道样式 pigz -d test.tgz | tar -xf
有效,在这种情况下,我也可以只使用调用内置 gzip 的 tar -xf test.tgz
。不过我只是想确认一下是不是bug
该程序按设计运行:其 command-line 中没有规定传递使用 gzip
解压缩所需的 选项 。而不是 "gzip" 用于解压缩,您应该使用包装的 gzcat
,例如
tar --use-compress-program gzip -cf foo.compressed foo
tar --use-compress-program gzcat -tf foo.compressed
快速检查表明这不起作用:
tar --use-compress-program 'gzip -d' -tf foo.compress
虽然这可能会改变一些时间(这是可行的,但还没有完成)。
根据 pigz 的 manual page,它有 unpigz
,这是您可以用于 that 程序的内容。
在 linux 我将 gzip 重命名为 gzip.sav 并为 pigz 制作了软 link 所以 tar、dolphin、yum 和任何其他实际调用 gzip 的程序呼叫猪
这是 BSD tar 和 GNU tar 之间的问题。
我通过从自制程序安装 gnu-tar
并将其放在路径上来修复此问题。
查看关于超级用户的类似问题:https://superuser.com/questions/318809/linux-os-x-tar-incompatibility-tarballs-created-on-os-x-give-errors-when-unt
我通过自制软件在我的 Macbook Air (OS X 10.10.5) 上安装了 pigz 以获得更好的 compress/decompress.
性能压缩,我用的是tar --use-compress-program=pigz -cf test.tgz test
,没问题。
但是命令解压,tar --use-compress-program=pigz -xf test.tgz
输出错误:
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
或者有时它输出:
tar: Unrecognized archive format
pigz: abort: write error on <stdout> (Broken pipe)
tar: Child process exited with status 32
tar: Error exit delayed from previous errors.
我读了 manual of tar,不知道为什么它不起作用。
我注意到甚至 tar --use-compress-program=gzip -xf test.tgz
也会产生同样的错误。那么这是 OSX 的 tar 实现的错误吗?
注意:我知道管道样式 pigz -d test.tgz | tar -xf
有效,在这种情况下,我也可以只使用调用内置 gzip 的 tar -xf test.tgz
。不过我只是想确认一下是不是bug
该程序按设计运行:其 command-line 中没有规定传递使用 gzip
解压缩所需的 选项 。而不是 "gzip" 用于解压缩,您应该使用包装的 gzcat
,例如
tar --use-compress-program gzip -cf foo.compressed foo
tar --use-compress-program gzcat -tf foo.compressed
快速检查表明这不起作用:
tar --use-compress-program 'gzip -d' -tf foo.compress
虽然这可能会改变一些时间(这是可行的,但还没有完成)。
根据 pigz 的 manual page,它有 unpigz
,这是您可以用于 that 程序的内容。
在 linux 我将 gzip 重命名为 gzip.sav 并为 pigz 制作了软 link 所以 tar、dolphin、yum 和任何其他实际调用 gzip 的程序呼叫猪
这是 BSD tar 和 GNU tar 之间的问题。
我通过从自制程序安装 gnu-tar
并将其放在路径上来修复此问题。
查看关于超级用户的类似问题:https://superuser.com/questions/318809/linux-os-x-tar-incompatibility-tarballs-created-on-os-x-give-errors-when-unt