Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just received some files file(s).tgz... I've tried tar -xvzf file.tgz... However I'm getting error "Attempt to write to an empty file"... Am I missing something... The folder directory system has been made but all the directories are empty...


share|improve this question

migrated from Feb 21 '10 at 20:18

This question came from our site for professional and enthusiast programmers.

I cannot find the string "Attempt to write to an empty file" in the source code for tar or gzip. Is that the exact error message, or are you rephrasing? – Jacob Feb 21 '10 at 18:14
Exact message... I'm on MacOX... bsdtar 2.6.2 - libarchive 2.6.2 – Simon Feb 21 '10 at 18:16

A similar issue is encountered at

It looks like a bug in BSD tar, which is the default tar on FreeBSD, Mac OS X, and possibly other systems.

Easiest workaround is probably to extract with GNU tar. Just run "gnutar" instead of "tar" if you're on OS X. On FreeBSD you may need to install gnutar from ports.

share|improve this answer
I was using BSD tar... and I needed to use GNU tar.... On Mac OSX use "gnutar -xvzf"... Many thanks... – Simon Feb 21 '10 at 18:25
Then you might as well accept the answer :-) – Nathan Fellman Feb 21 '10 at 22:17
Nice. On Mac OS X, I did the following: brew install gnu-tar Then just made sure my path was updated to include that tar first, then it works fine. – Wing Tang Wong May 11 '15 at 4:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .