You are not logged in.

#1 2011-07-15 20:19:08

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

tar chokes on files containing a colon (:) [solved]

Can someone show me the error of my way?  Here is a small test file from [extra] that fails when I attempt to extract it (see example below).

$ wget ftp://ftp.gtlib.gatech.edu/pub/archlinux/extra/os/x86_64/lirc-1%3A0.9.0-4-x86_64.pkg.tar.xz
$ tar zxvf lirc-1\:0.9.0-4-x86_64.pkg.tar.xz 
tar (child): lirc-1\:0.9.0-4-x86_64.pkg.tar.xz: Cannot open: Input/output error
tar (child): Error is not recoverable: exiting now

gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error is not recoverable: exiting now

This is a non sequitur to me.  Wrapping the filename in double quotes does not help either.  If I rename the file wo/ the colon, it extracts just fine. WTF?  Note: fileroller extracts the file just fine without renaming it.  Why doesn't the backslash escape the colon?  My shell is bash.

Last edited by graysky (2011-07-15 20:40:26)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2011-07-15 20:32:42

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: tar chokes on files containing a colon (:) [solved]

Something with a colon in it is expected to be a remote resource. Using --force-local is what you want. Also, a .xz is not compatible with 'z', perhaps you meant 'J'?

Edit: I should specify, you can also prefix the thing with ./ (that is, a local path). It's just assuming that lirc-1 is some protocol, which it then doesn't understand (I think it uses rsh or something for fetching).

Last edited by jac (2011-07-15 20:36:59)

Offline

#3 2011-07-15 20:36:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: tar chokes on files containing a colon (:) [solved]

bsdtar works.

Offline

#4 2011-07-15 20:40:16

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: tar chokes on files containing a colon (:) [solved]

thanks for the info, guys. 

@jac - you're right, it's j not x smile and the ./archive.tar.xz works
@karol - bsdtar -xf archive.tar.xz works great, thanks


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB