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 !).