LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   tar fails to extract archive containing special characters (https://www.linuxquestions.org/questions/linux-general-1/tar-fails-to-extract-archive-containing-special-characters-884672/)

shadowbox12 06-05-2011 10:36 AM

tar fails to extract archive containing special characters
 
The command tar -xvf wpa_tables.tar gives this error
tar: ./xai-0/\334Regency: Cannot open: Invalid or incomplete multibyte or wide character
tar: Exiting with failure status due to previous errors

Obviously the backslash is giving tar some problem, but I've been all over the docs and can't figure out how to either make it skip this file or interpret the character literally. Here's my command history to show some of the options I've tried which don't work.

tar --no-wildcards -xkvf wpa_tables.tar
tar --exclude ./xai-0/\\334Regency -xkvf wpa_tables.tar
tar --exclude "./xai-0/\\334Regency" -xkvf wpa_tables.tar
tar --ignore-command-error -xkvf wpa_tables.tar
tar --ignore-failed-read -xkvf wpa_tables.tar
tar --transform 's/\\/slash/g' -xvf wpa_tables.tar ./xai-0/\\334Regency

I'm totally out of ideas at this point and would welcome some input from more experienced members.

shadowbox12 06-05-2011 11:26 AM

Solved
 
Damn if I didn't figure it out on my own. Maybe this will help someone else. The problem is that I was trying to extract the files onto a FAT partition. Extracted them onto ext3 and there was no longer a problem.

yenco 09-14-2011 06:05 AM

Thanks shadowbox12,

got the same error on a NTFS partition.
As you said - extract to ext3 successful.

For anyone who has only a fat or ntfs partition to extract to:
The problematic file seems to be the last one being extracted from the tar archive. So you only miss this one file when tar fails with its error.
(Here the last few lines of tar output (successful extraction on ext3)
Code:

./xai-0/wxyz
./xai-0/yale wireless
./xai-0/\334Regency
nice tar xvf  2.98s user 133.10s system 6% cpu 34:29.39 total

)


All times are GMT -5. The time now is 06:01 AM.