bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] [patch v3] Bug / question in tar


From: Nathan Stratton Treadway
Subject: Re: [Bug-tar] [patch v3] Bug / question in tar
Date: Sun, 30 Mar 2014 17:51:52 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

On Sat, Mar 29, 2014 at 15:11:08 -0600, Eric Blake wrote:
> On 03/29/2014 02:55 PM, Paul Eggert wrote:
> 
> > It sounds like enough people are misusing GNU tar in the way you
> > describe that, if we improved its performance in this case, we'd need to
> > add a --be-stupid option so that tar would continue to read data that it
> > doesn't need to.  (Perhaps you could come up with a better name for the
> > option.  :-)
> 
> Maybe: --dry-run

Note that there are actually three different possible behaviors related
to the data from the input files:

  1) read and write it 
  2) read it but don't write it                   
  3) don't read it (and thus don't write it)

(So, mode 1 would be normal operation, mode 2 is what you'd use for
verifying a CD or filling the disk cache, etc., and mode 3 is what you'd
want things like estimating backup sizes.)

Currently gtar automatically switches to mode 3 when it detects that the
output file is /dev/null, and there's no way to select mode 2.

On systems with /dev/null (or /dev/zero), using mode 1 with the output
directed to the special file is fairly close to mode 2, though there's
some additional overhead pumping the data through to the OS so the OS
can discard it.  (I'm not sure how much overhead that is on various
systems... nor if there are systems that gtar runs on that don't have
/dev/null or equivalent available and thus where it would be handy to
have an explict mode 2 case.)


Anyway, in terms of adding new options to GNU tar, one approach would be
to have two separate options, one controlling whether the data files are
read, and the other whether the data is written.  (But obviously having
read turned off would imply write was turned off as well.)

Alternatively, there could be a single option with a three-stage mode
setting.

Or we could go with a single boolean option (e.g. "--dry-run"), which
would be used to select between modes 1 and 3, with no explicit way to
choose mode 2.  (Presumably --no-dry-run would be available to force
gtar to use mode 1 [or perhaps 2] when output was going to /dev/null.)


                                                Nathan

----------------------------------------------------------------------------
Nathan Stratton Treadway  -  address@hidden  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239



reply via email to

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