Bug 30850

Summary: prevent tar from creating empty tar files in some cases
Product: Base System Reporter: Mark Stosberg <mark>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-RELEASE   
Hardware: Any   
OS: Any   

Description Mark Stosberg 2001-09-26 21:40:00 UTC
I would like for the tar binary to prevent the creation of empty tar files when no files are specified to tar up. Here's my "use case": I just downloaded a big tar, gzipped file and want to unpack it. I use: tar -czvf bigfile.tgz
Oops, I just clobbered my file instead of opening it, despite having not specified 
any files to put in this new archive.

Fix: 

Here's now GNU tar handles this, which I like better:

$ tar -czvf tmp.tgz
tar: Cowardly refusing to create an empty archive
Try `tar --help' for more information.

Perhaps I'm overlooking a good reason to support the ability to create empty archives. 
Thanks, -mark
How-To-Repeat: tar -czvf test.tgz
Comment 1 Mark Stosberg 2001-09-26 21:46:18 UTC
Sorry, this is a dupe of bug #22211. 

 -mark
Comment 2 ru freebsd_committer freebsd_triage 2001-10-04 11:28:58 UTC
State Changed
From-To: open->closed

Duplicate of PR bin/22211.