bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] option -C ignored when it comes after the source directory


From: Bruno Haible
Subject: [Bug-tar] option -C ignored when it comes after the source directory
Date: Sat, 15 May 2010 00:30:59 +0200
User-agent: KMail/1.9.9

Hi,

Seen with tar-1.23 on a glibc system:
  $ tar cf - . -C /mnt
has a different effect than
  $ tar cf - -C /mnt .

How to reproduce:

  $ cd $HOME
  $ tar cvf - . -C /mnt > /dev/null
  [lists the files of your home directory]
  $ tar cvf - -C /mnt . > /dev/null
  [lists the files under /mnt]

I consider this a bug for two reasons:

1) glibc systems use GNU getopt. It allows to mix command line options with
   regular arguments. The very idea of this feature is that
     PROG ARGS OPTIONS
   is equivalent to
     PROG OPTIONS ARGS

2) The only effect of the -C option when creating an archive is to set the
   directory relative to which the source directory is interpreted. It is
   certainly not the intent of the user to specify an option that has no
   effect (and indeed 'tar' has not warned about this option having no effect).

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]