Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-06-2004, 01:58 PM   #1
LQ Newbie
Registered: Nov 2004
Distribution: Debian
Posts: 16

Rep: Reputation: 0
Angry My TAR - ed source code isnt the same when I unTAR it

Every time I stop working on a particular project, I tar up the whole directory where I was working, (ie writing C++ code)

tar -cvf Friday_Afternoon.tar ./

,storing compiled program , source and everything in that one tarball.

That way I conveniently send it home to work on for the weekend.
In fact, it doesnt matter wether this .tar gets emailed or not,
when I untar it
tar -xvf Friday_Afternoon.tar
in a new directory,
the source is almost intact, except for one file which gets totally mangled,
mainly: I can read the content of some of the other files inside it (those that are in the directory,some are included in said file that s got corrupted) at other places,
stuff like this:
./filename.hpp~0100600415261000056020000000513210154076776012745 0
ustar myUserName
and at other places, stuff that looks like compiled code

��������,���� `���:̍^LI܍V �4Z�
u��E�^�� `��kP�~"
_ ┌ <Q L \ " ┌

(aspect changed when pasted into this post)
followed by stuff like this, which i never typed in said source file:


So, just about anything can be found in the file, except the original source, which is nowhere to be seen
Am I tarring untarring it wrong?
is it because there s some compiled program along with the sources in the archive?
can it be because some of the source files contain the words #include another file in the dir (seems a common case !).
Old 12-06-2004, 02:47 PM   #2
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Odd, never had a problem with it here and I tar source code that includes several binaries all the time. The only thing I do differently is that I back out of the directory containing the source first, then tar that directory.

cd ..
tar cvf mysource.tar mysource

Doing it the way you are, it may be trying to tar the tar file it's creating, since that file would become part of the directory you're tarring. Maybe that is messing it up.

Last edited by DaHammer; 12-06-2004 at 02:50 PM.
Old 12-06-2004, 02:58 PM   #3
LQ Newbie
Registered: Nov 2004
Distribution: Debian
Posts: 16

Original Poster
Rep: Reputation: 0
very right!

you must have been very right -
when i do as you suggest, it works normally.

The possibility that it d start tarring its own output along with hadnt crossed my mind - pbly I d expect an error to be thrown in that case, as the command could never stop then.. and tar never told me even a warning.

But it works when i do it as you say!

Thanks a lot!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to untar all tar-files in a directory? zoomzoom Linux - Newbie 13 05-09-2017 12:52 PM
massive tar file, can't untar dtra Linux - Software 3 09-08-2011 05:32 AM
untar a list of tar files? Rotwang Linux - General 6 10-10-2006 02:34 PM
Getting problem when untar the .tar.gz file? ramakumard77 Linux - General 2 11-29-2004 12:15 PM
Untar filename.tar.tar Dr.Swing Linux - Newbie 12 09-27-2002 08:10 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration