This is the mail archive of the
mailing list for the Cygwin project.
Re: tar, win-path conversion bug
- From: mwoehlke <mwoehlke at tibco dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 27 Jul 2006 14:08:57 -0500
- Subject: Re: tar, win-path conversion bug
- References: <44C6C0B6.firstname.lastname@example.org>
Linda Walsh wrote:
I think I've run into a bug concerning "tar" and the use of
windows format paths. It's not a bug that is difficult to work
around, but it still seems as though it is a bug that someone may
wish to address (in their spare time, of course :-).
I wanted to save a list of files into a tar archive where the
list was created by a windows-based utility that generated
Just to see if it was "supported" at all, I decided to try it with
1 file first, before attempting the whole archive.
Created file /tmp/tst that contained 1 filename:
My command line was:
tar cvpf /tmp/tst.tar -T /tmp/tst --ignore-case --no-recursion
My output was:
tar: Removing leading `c:\' from member names
tar: c\:\\WINDOWS\\msagent\\chars\brocklee.acs: Cannot stat: No such
file or directory
tar: Substituting `.' for empty member name
tar: : Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
> ls -lGg C:\\Windows\\msagent\\chars\\brocklee.acs
-rw-r----- 1 3614596 Jul 5 2002 C:\Windows\msagent\chars\brocklee.acs
Note in "tar", the backslash before the filename wasn't
doubled as were the other backslashes:
If I edit the input file and add an extra "backslash" before
the filename, like:
^ extra backslash
Then tar "works".
Just a guess... '\b' is a valid escape sequence (backspace, or 0x08 in
ASCII). None of the other characters after '\'s are valid escape
sequences. Therefore it looks like 'tar' treats '\' followed by a
character as an escape sequence if it recognizes it, otherwise it treats
it literally. The other solution would be to use a sed script to double
the '\'s, but as you observed, using POSIX paths would be better.
I forget if '-T -' is valid; if it is, you could do something like:
cat file_list.txt | xargs -n 1 cygpath -u | tar <args> -T - <args>
Ok, so the quotes aren't entirely original.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html