bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Feature request (patch): ignore requested members missing


From: Vladimir A . Pavlov
Subject: Re: [Bug-tar] Feature request (patch): ignore requested members missing in archive
Date: Mon, 23 Jun 2014 21:20:28 +0400

Hello Pavel,

> Just a nit, here should be (for readers):
> 
>   $ tar -c file | tar -t dir

Oops, thanks you. That's exactly what I mean.

> I don't like the '--ignore-missing' approach.  That adds another
> non-symetric option to tar.  We have the '--ignore-failed-read' option
> which works for archive creation and --ignore-missing works just for
> archive extraction.

How can we solve this? AFAIU you suggest something like reusing
--ignore-failed-read for the feature in question (correct me if I'm wrong).

But --ignore-failed-read is not exactly what I mean because:
1. it outputs a warning meaning "something unexpected happens":
   $ tar --ignore-failed-read -cf /dev/null non-existing
   tar: non-existing: Warning: Cannot stat: No such file or directory
   $
2. according to the sources it means ignoring any read errors, not
   only "existance" ones,

On the contrary, the suggested --ignore-missing suggests that:
1. missing member is expected so no warning is necessary when this
   happens,
2. if a member exists but cannot be processed for some other reason,
   an error must still be returned.

If I correctly understand you --ignore-missing can be modified to ignore
missing files on archive creation as well:
$ tar --ignore-failed-read -cf /dev/null non-existing
tar: non-existing: Warning: Cannot stat: No such file or directory
$ echo $?
0
$ tar --ignore-missing -cf /dev/null non-existing
$ echo $?
0
$

If a file exists and is unreadable for some other reason (e.g. permissions)
an error is still returned (unless using --ignore-failed-read) and a
warning/error is printed.

In this case there are questions:
1. Must --ignore-missing be applied to symlinks leading nowhere?
1.a. Must we also take into account --dereference?
2. Are there cases where --ignore-missing must be applied not only to files
   provided on the command line/TAR_OPTIONS/-T?
3. (combination of 1. and 2.) How must tar behave if it finds a broken
   symlink inside a directory provided on the command line?

IMHO,
1. no (unless --dereference is used, but it's case 1.a.),
1.a. uncertain, probably no (if a symlink exists it must reference an existing
     file or an error is returned),
2. no,
3. it must behave as if --ignore-missing is not used.

It's just a quick thought. I have no use case for --ignore-missing during
archive creation right now so I might be wrong.

What do you think?

-- 
Vladimir A. Pavlov

reply via email to

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