Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

maybe I'm out of the loop on tar, but:

Status
Not open for further replies.

Chapter11

Technical User
Apr 15, 2002
791
US
I'm having a really odd problem with tar.

I can create a .tar file, initially empty. Later, I add files to it (via -u or -r). The size of the tarfile grows as expected.

The problem is that trying to -t (view contents) or -x (extract) the tarfile returns with no data and no error, as if the tarfile is still an empty tarfile.

Can someone tell me what I'm doing wrong?

(AIX 4.3.3 ml09)
 
just curious - how do you create empty tar file??
check out $file blank.tar - is it a tar file??
 
Assuming you're using AIX's tar:

tar -cvf filename.tar

It will create a 10k filename.tar that contains nothing except the tar format header.

GNU's version of tar is cowardly and refuses to create empty tar files.

I solved the problem I was having though, but it did require GNU's tar:

The tarfile I had data in (that was added via -u), was actually silently erroring out. I tried tar -tivf filename.tar, and it reported that there was a header error, but listed the file I expected. I couldn't get it to report on any files in subsequent sections, but gnu's tar will process the entire file, not just the first header or two. I haven't -x'ed the data, but I'm leaving that to the people who are having the problem to begin with =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top