Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bin/35087: TAR does not recurse directories if it runs into a file with "\" in the title followed by a space.

0 views
Skip to first unread message

kera...@freebsd.org

unread,
Feb 24, 2002, 5:11:23 PM2/24/02
to
The following reply was made to PR bin/35087; it has been noted by GNATS.

From: Giorgos Keramidas <kera...@freebsd.org>
To: Clint <clint+fre...@acm.vt.edu>
Cc: bug-fo...@freebsd.org
Subject: Re: bin/35087: TAR does not recurse directories if it runs into a file with "\" in the title followed by a space.
Date: Sun, 24 Feb 2002 23:57:15 +0200

On 2002-02-18 11:32, Clint wrote:

> It seems like putting a "\" in the filename is causing tar to mess up ...
> it wont recurse directories. A script that I'd been using for years
> finally died when I created a file called something like "__\ reminder\
> to\ self\ __" ... The resulting tar would only be the files in the root
> directory -- it stopped recursing when it hit the filename with spaces
> and backslashes in it. And nowadays with windows supporting long
> filenames, most filenames have spaced in them (to my experience, having
> over a terabyte of my own data.)

Hello Clint,

Are you sure this is not some bug of shell quoting, or the way you invoke
tar(1)? It seems to work nicely here, for the filename you gave as an
example. Perhaps there is a problem, and if you provided us with the exact
script and/or program that invokes tar(1) we could research this more :)

See for instance what happens on a -CURRENT box I use as a workstation at
home. The last time I build world was Feb 17, 2002:

[ create a test spac in /tmp/0 ]

% cd /tmp
% mkdir 0
% cd 0

[ create the file of the bug-report ]

% touch "__\ reminder\ to\ self\ __"
% ls -la
total 2
drwxr-xr-x 2 charon wheel 512 Feb 23 18:24 ./
drwxrwxrwt 5 root wheel 512 Feb 23 18:23 ../
-rw-r--r-- 1 charon wheel 0 Feb 23 18:24 __\\ reminder\\ to\\ self\\ __

[ file shows up ok, now create some normal files to test tar(1) ]

% touch lala
% ls -la
total 2
drwxr-xr-x 2 charon wheel 512 Feb 23 18:24 ./
drwxrwxrwt 5 root wheel 512 Feb 23 18:23 ../
-rw-r--r-- 1 charon wheel 0 Feb 23 18:24 __\\ reminder\\ to\\ self\\ __
-rw-r--r-- 1 charon wheel 0 Feb 23 18:24 lala
% mkdir foo
% touch foo/bar
% ls -lR
total 1
-rw-r--r-- 1 charon wheel 0 Feb 23 18:24 __\\ reminder\\ to\\ self\\ __
drwxr-xr-x 2 charon wheel 512 Feb 23 18:24 foo/
-rw-r--r-- 1 charon wheel 0 Feb 23 18:24 lala

./foo:
total 0
-rw-r--r-- 1 charon wheel 0 Feb 23 18:24 bar

[ try to create a tarball of current directory in /tmp/0.tgz ]

% tar cvf - . | gzip -9c - >/tmp/0.tgz
./
__\\ reminder\\ to\\ self\\ __
lala
foo/
foo/bar

[ worked. now let's see what was written in the tarball. ]

% cd /tmp
% tar tzvf 0.tgz
drwxr-xr-x charon/wheel 0 Feb 23 18:24 2002 ./
-rw-r--r-- charon/wheel 0 Feb 23 18:24 2002 __\\ reminder\\ to\\ self\\ __
-rw-r--r-- charon/wheel 0 Feb 23 18:24 2002 lala
drwxr-xr-x charon/wheel 0 Feb 23 18:24 2002 foo/
-rw-r--r-- charon/wheel 0 Feb 23 18:24 2002 foo/bar

Everything seems to work like a charm. Can we have a look at the program
that seems to show the tar(1) misbehavior for you?

Giorgos Keramidas FreeBSD Documentation Project
keramida@{freebsd.org,ceid.upatras.gr} http://www.FreeBSD.org/docproj/

To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message

0 new messages