star issue when creating archives

[email protected] Tue, 1 Mar 2011 18:22:58 -0000
Newsgroups gmane.comp.archivers.star.user
Message-ID <21d597f95e126aa677e76f2ba2a415ad.squirrel@ssl-webmail-vh.clara.net>
Hi,

I'm writing to report a possible star bug/issue/misfeature. (I'm using
star 1.5 on Linux.)

When creating an archive which is a normal file, if the archive file
already exists it is silently overwritten, but the file length is not
changed. So stale/old data remains at the end of the archive when the
amount of data written is less than the old archive length.

By comparison, GNU tar also overwrites the file silently, but truncates it
so no stale data remains at the end.

I think it would be preferable to by default print a message saying the
archive already exists and exit. If the user overrides that, star should
truncate the (existing) archive file so no previous data remains.

To demonstrate the problem, try this (where file1 and file2 are any files):
  star -v -c f=archive.tar file1 file2
  ls -l archive.tar
  star -v -c f=archive.tar file2
  ls -l archive.tar
  star -v -t f=archive.tar

Compare with doing:
  tar -vcf gnu_archive.tar file1 file2
  ls -l gnu_archive.tar
  tar -vcf gnu_archive.tar file2
  ls -l gnu_archive.tar
  tar -vtf gnu_archive.tar


Mark