[Top][All Lists]

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

Re: [Bug-cpio] cpio suggestion: --quick-exit

From: Tim Kientzle
Subject: Re: [Bug-cpio] cpio suggestion: --quick-exit
Date: Sat, 22 Aug 2009 17:55:21 -0700
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv: Gecko/20090601 SeaMonkey/1.1.16

Carl Sopchak wrote:

This is a suggestion for a new option to cpio, --quick-exit. The purpose of the option is to exit cpio as soon as the requested file(s) have been restored, instead of reading all the way through the archive.

Perhaps it would be better to implement the GNU tar --occurrence

       process only the NUMBERth occurrence of each file
       in the archive; this option is valid only in
       conjunction with one of the subcommands --delete,
       --diff, --extract or --list and when a list of
       files is given either on the command line or via
       the -T option; NUMBER defaults to 1

or the older --fast-read aka -q supported by FreeBSD's
tar (which used to be a patched GNU tar, since replaced
by bsdtar):

   -q (--fast-read)
       (x and t mode only) Extract or list only the first archive entry
       that matches each pattern or filename operand.  Exit as soon as
       each specified pattern or filename has been matched.  By default,
       the archive is always read to the very end, since there can be
       multiple entries with the same name and, by convention, later
       entries overwrite earlier entries.  This option is provided as a
       performance optimization.

Your notion of allowing this to work for specifying a directory
(exiting as soon as something outside of the directory is seen)
sounds rife for confusion, though.  Besides append operation,
it's a little dangerous to make strong assumptions about the
order in which items are written into archives.  (Witness the
very different orders that GNU tar, star, and bsdtar use
for visiting directories.)


reply via email to

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