bug-gnu-utils
[Top][All Lists]
Advanced

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

address@hidden: Re: tar 1.13.25 error handling]


From: Gerhard Poul
Subject: address@hidden: Re: tar 1.13.25 error handling]
Date: Sat, 8 Mar 2003 11:29:23 +0100
User-agent: Mutt/1.3.28i

Hi,

maybe someone else is able to contribute to this thread.

I'm not really sure how to handle it. We could modify the messages tar
produces but I'm not sure it would be much of a benefit.

Do you think we should check _before_ writing anything if the directory is
at all readable and die?

yours,
  gpoul

----- Forwarded message from Martin MOKREJ? <address@hidden> -----

Envelope-to: address@hidden
X-Obalka-From: address@hidden
X-Obalka-To: <address@hidden>
From: Martin MOKREJ? <address@hidden>
To: Gerhard Poul <address@hidden>
Subject: Re: tar 1.13.25 error handling
X-MIME-Autoconverted: from 8bit to quoted-printable by tao.natur.cuni.cz id 
h22NbBpn053322
X-Spam-Status: No, hits=-11.5 required=5.0
        tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,
              SPAM_PHRASE_01_02,USER_AGENT_PINE
        version=2.41
X-Spam-Level: 
X-UIDL: nBS!!/4D!!I!9!!:cQ!!

On Sat, 1 Mar 2003, Gerhard Poul wrote:

> > > Before you _write_ to a file you'll have to open it. And opening it is 
> > > what fails.
> >
> > Really? I have to open first a file which doesn't exist? Are we NOT
> > opening file in a write mode with CREATE option, so that it get's
> > CREATED and OPENed for writing?
>
> Yes. - exactly. We open() it for writing. And exactly this open() syscall
> fails because we don't have the necessary permissions.

But if so strictly speaking, no-one should ever use the word "write" but
use "open in write mode" instead. That doesn't make sense.

The user I believe doesn't care how is it programmed, for him it is just
creating and writing a file, or reading a file.

>
> > > And it gives the right error... permission denied.
> >
> > Sure, but I'd expect tar should die because it couldn't create/open the
> > *directory* where that file should be stored! I don't understand why tar
> > should continue when it has no test/ subdirectory available to write the
> > files into!
>
> That's because we haven't put the 'test' directory into our tar file but
> rather tar'ed them from our pwd. So tar just tries to open the file it
> has to extract without creating a directory first. If you had the directory
> in the archive the directory creation would fail.
>
> Do you understand now how it works?


I think I got the point, unfortunately I still don't understand why these
two cases should be distinguished at all.

When a user asks for contents of an archive to be extracted into some
subdirectory, and the subdirectory cannot be created, I believe it is
still legitimate for tar to exit, as it just cannot write *ANY* of the
archiv contents into requested subdirectory.

Why should tar continue at all in this case? It's just waste of CPU and
IO. It just doesn't matter what it extracts from the archive, because it
will never be able to write it! It should just die. And with "Cannot write
to ...", or better "cannot create directory xy" at the best, which user
requested to be created. ;)

I hope my objectives are clear to you, and I know we probably won't
converge with opinions. What a pity. ;) But thanks for replies, Gerhard!

>
> yours,
>   gpoul
>

-- 
Martin Mokrejs <address@hidden>, <address@hidden>
PGP5.0i key is at http://www.natur.cuni.cz/~mmokrejs
MIPS / Institute for Bioinformatics <http://mips.gsf.de>
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1, D-85764 Neuherberg, Germany
tel.: +49-89-3187 3683 , fax:?+49-89-3187 3585


----- End forwarded message -----




reply via email to

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