Article View: gnu.utils.bug
Article #637Re: Idea for tar
From: gnu
Date: Tue, 25 Aug 1992 12:14
Date: Tue, 25 Aug 1992 12:14
32 lines
1823 bytes
1823 bytes
Hugh Daniel <hugh@toad.com> suggested:
> I have had the problem that I sometimes type "tar -zcf foo.tar.Z"
> insted of "tar -zxf foo.tar.Z". With gnutar this puts the current
> directory tree in the file, thus trashing my file.
> This seems like a new behavior to me, I would much prefer it that if
> I don't give any files to put in the archine if does *NOTHING*.
> Is there a reason why this could not be done?
> ||ugh
This *is* a new behaviour (assuming "." if no files are specified).
I think it is a mistake.
The old tar program would create an empty archive (with just an EOF
record in it), if you asked it to create an archive with no files
specified.
I believe that that is the proper thing to do. Utilities should not
do surprising things in edge-cases. A program that is asked to archive
two files, one file, or zero files, should act basically the same.
There should be no `singularity' around the zero point.
This would still not solve Hugh's problem, since it would wipe out his
file and replace it with an empty file, rather than replacing it with
the contents of his current directory. All I can recommend there is
to make your tar archives read-only ("take out the write ring") to avoid
disasters.
(It should be easy for Hugh to put a shell script "tar" on his path,
that checks for this case and produces an error instead of running the
real "tar".)
John Gilmore
Technical Details
Message-ID:
<9208260214.AA28979@toad.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!toad.com!gnuReferences:
<9208202203.AA15497@ecotone.xanadu.com>Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!toad.com!gnu From: gnu@toad.com Subject: Re: Idea for tar Message-ID: <9208260214.AA28979@toad.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet References: <9208202203.AA15497@ecotone.xanadu.com> Distribution: gnu Date: Tue, 25 Aug 1992 12:14:04 GMT Approved: bug-gnu-utils@prep.ai.mit.edu Lines: 33