LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-06-2004, 12:58 PM   #1
LaoNiu
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

�p��<������^L^L�
.��1F��Zp�j��,o<�N�����L�.�\�/�l������|�
��������,���� `���:̍^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:

ompleted.1__do_global_dtors_aux__EH_FRAME_BEGIN__fini_dummyobject.\
2frame_dummyinit_dummyforce_to_data__CTOR_LIST____do_global_ctors_a\
ux__CTOR_END____DTOR_END____FRAME_END__testGLUT.cppKey__FU\
ciiReshape__Fii__PRETTY_FUNCTION__.451__EXCEPTION_TABLE____FR\
AME_BEGIN__cerrglutKeyboardFunc_DYNAMICclose__11fstreambaseendl__\
FR7ostreamglFlush_fp_hwHeightglutMainLoop_._8ofstreamglutCreateWindow_\
_assert_fail@


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, 01:47 PM   #2
DaHammer
Member
 
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 01:50 PM.
 
Old 12-06-2004, 01:58 PM   #3
LaoNiu
LQ Newbie
 
Registered: Nov 2004
Distribution: Debian
Posts: 16

Original Poster
Rep: Reputation: 0
very right!

OK
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!
 
  


Reply



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 11:52 AM
massive tar file, can't untar dtra Linux - Software 3 09-08-2011 04:32 AM
untar a list of tar files? Rotwang Linux - General 6 10-10-2006 01:34 PM
Getting problem when untar the .tar.gz file? ramakumard77 Linux - General 2 11-29-2004 11:15 AM
Untar filename.tar.tar Dr.Swing Linux - Newbie 12 09-27-2002 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:02 PM.

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