public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* tar, win-path conversion bug
@ 2006-07-26  1:20 Linda Walsh
  2006-07-27  3:35 ` Eric Blake
  2006-07-27 19:14 ` mwoehlke
  0 siblings, 2 replies; 4+ messages in thread
From: Linda Walsh @ 2006-07-26  1:20 UTC (permalink / raw)
  To: cygwin

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
windows-style pathnames.

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:
c:\WINDOWS\msagent\chars\brocklee.acs

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 gives:
 > 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:
    tar: c\:\\WINDOWS\\msagent\\chars\brocklee.acs
                                     ^^

If I edit the input file and add an extra "backslash" before
the filename, like:
c:\WINDOWS\msagent\chars\\brocklee.acs
                         ^ extra backslash

Then tar "works".

Easy workaround is to convert the paths to unix-type paths.

-linda





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tar, win-path conversion bug
  2006-07-26  1:20 tar, win-path conversion bug Linda Walsh
@ 2006-07-27  3:35 ` Eric Blake
  2006-07-27  7:10   ` Christopher Faylor
  2006-07-27 19:14 ` mwoehlke
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Blake @ 2006-07-27  3:35 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Linda Walsh on 7/25/2006 7:09 PM:
> 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 :-).

It's certainly not the highest priority on my list.  I would just stick
with POSIX paths.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
volunteer cygwin tar maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEyDQq84KuGfSFAYARAgSaAJ4lHDaro769M4+RiR5Ts3huUxu+TgCfXgK3
0DEh/jwn4ZZ5RZ1oHGAaVvs=
=DjYt
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tar, win-path conversion bug
  2006-07-27  3:35 ` Eric Blake
@ 2006-07-27  7:10   ` Christopher Faylor
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Faylor @ 2006-07-27  7:10 UTC (permalink / raw)
  To: cygwin

On Wed, Jul 26, 2006 at 09:34:02PM -0600, Eric Blake wrote:
>According to Linda Walsh on 7/25/2006 7:09 PM:
>>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 :-).
>
>It's certainly not the highest priority on my list.  I would just stick
>with POSIX paths.

What a crazy idea.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tar, win-path conversion bug
  2006-07-26  1:20 tar, win-path conversion bug Linda Walsh
  2006-07-27  3:35 ` Eric Blake
@ 2006-07-27 19:14 ` mwoehlke
  1 sibling, 0 replies; 4+ messages in thread
From: mwoehlke @ 2006-07-27 19:14 UTC (permalink / raw)
  To: cygwin

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
> windows-style pathnames.
> 
> 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:
> c:\WINDOWS\msagent\chars\brocklee.acs
> 
> 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 gives:
>  > 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:
>    tar: c\:\\WINDOWS\\msagent\\chars\brocklee.acs
>                                     ^^
> 
> If I edit the input file and add an extra "backslash" before
> the filename, like:
> c:\WINDOWS\msagent\chars\\brocklee.acs
>                         ^ 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>

-- 
Matthew
Ok, so the quotes aren't entirely original.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-27 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-26  1:20 tar, win-path conversion bug Linda Walsh
2006-07-27  3:35 ` Eric Blake
2006-07-27  7:10   ` Christopher Faylor
2006-07-27 19:14 ` mwoehlke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).