LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-27-2004, 12:42 PM   #1
diam0nd
Member
 
Registered: Nov 2003
Posts: 34

Rep: Reputation: 15
I can't believe it... xedit ruined my C project...


I had to finish my academic project in C language until 31/8, and just now, xedit ruined it!!!
I don't know what to do... I think it is xedit, because only when I write files with xedit it ruines them.
now, one of my important source files looks like that:

file1.c^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ustar^@^@^@^@username
<content of file1.c>
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
file2.c^@^@^@^@^@^@^@^@^@^@^@^@^@ustar^@^@^@^@^@username^@^@^@^@^@
<contentof file2.c>
^@^@^@^@^@^@^@^@^@^@^@^@^@ustar^@^@^@^@^@username^@^@^@

and so on.......... where "username" is my username....
it does that for all fileX.c except my ruined file.... I just don't know what to do... and the file.c~ files are gone...
any idea what to do????
thanks alot alot for any advice...
 
Old 08-27-2004, 12:50 PM   #2
SirSlappy
Member
 
Registered: Jun 2003
Location: Glendale AZ
Distribution: Slackware 10
Posts: 153

Rep: Reputation: 30
NTFS

Was the file stored on a NTFS partition?
 
Old 08-27-2004, 01:10 PM   #3
SheldonPlankton
Member
 
Registered: Jun 2004
Posts: 129

Rep: Reputation: 15
Are you sure you didn't make this mistake ...
Code:
$ cat oops.c
#include <stdio.h>
 
main() {
        printf ( "hello world ...\n" );
}
$ gcc -o oops.c oops.c
$ vim oops.c
^?ELF^A^A^A^@^@^@^@^@^@^@^@^@^B^@^C^@^A^@^@^@x<82>^D^H4^@^@^@<^]^@^@^@^@^@^@4^@
^@^F^@(^@"^@^_^@^F^@^@^@4^@^@^@4<80>
I know I have ... that's why I use stuff like SCCS or CVS!
 
Old 08-27-2004, 02:52 PM   #4
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
I don't know much about this, you could try another editor.

But on a general note I hope you were smart enough to have recent backups made. For anything important you code you should do that like daily or everytime you worked on it.
 
Old 08-27-2004, 09:03 PM   #5
diam0nd
Member
 
Registered: Nov 2003
Posts: 34

Original Poster
Rep: Reputation: 15
SirSlappy: no it wasn't, it was on a ReiserFS partition.

SheldonPlankton: no I didn't do that, it was compiled by a makefile.

darkleaf: from now on, be sure I won't be using xedit anymore.
I didn't had backup files becuase my partner on the project wrote to delete them in the "make clean" section in the makefile.

Well I'm in trouble now. dunno what ill do...
 
Old 08-28-2004, 04:08 AM   #6
Not now, John!
Member
 
Registered: Jul 2004
Distribution: LFS 5.1
Posts: 161

Rep: Reputation: 30
Very odd problem...
Try opening those files with different charsets in some editor like Kate.
 
Old 08-28-2004, 05:24 AM   #7
diam0nd
Member
 
Registered: Nov 2003
Posts: 34

Original Poster
Rep: Reputation: 15
Not now, John! : that didn't help too
any idea where is the best place I can post help for this? some mailing list / discussion group or something?
 
Old 08-28-2004, 05:31 AM   #8
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
what filetype does file report for the corrupted file? ie if abc.c is corrupted what is the output of

file abc.c
 
Old 08-28-2004, 05:31 AM   #9
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Take a look if xedit did not create some temp files at the same folder where you have your project, usually something like "project.cpp~". I know that some editors do that...

Good luck mate!
 
Old 08-28-2004, 06:05 AM   #10
diam0nd
Member
 
Registered: Nov 2003
Posts: 34

Original Poster
Rep: Reputation: 15
man, I decided to make some "investigation" and to find out what is "ustar"... it is an algorithm or something used by tar to make tarballs.... so I tried to recall on what I did related with tar...
and now I remember I accidently (sp?) did this command:
tar -cf file1.c file2.c file3.c file4.c ...........

MANNN, I am so stupid!!!!
and that's why my ruined file1.c contains all other files in the project...
I am so ashamed I blamed xedit... I should blame myself!
and now I really see that file file1.c prints:
"file1.c: POSIX tar archive"

I guess there is no way to recover the file... no *.c~ files too... this is pure stupidity what I did there... now I know that linux doesn't ruin files by itself... it is all human mistakes.

well thanks anyways guys.
 
Old 08-28-2004, 06:15 AM   #11
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Couldn't you just untar the archive....?
 
Old 08-28-2004, 06:29 AM   #12
diam0nd
Member
 
Registered: Nov 2003
Posts: 34

Original Poster
Rep: Reputation: 15
I tried, but I didn't get file1.c... I get file2.c file3.c file4.c etc... coz the command was
"tar -cf file1.c file2.c file3.c file4.c" ...
is there any way I can recover file1.c to what it was *before* it was a tar archive?
 
Old 08-28-2004, 06:38 AM   #13
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
no, not as far as i know.
 
Old 08-30-2004, 05:52 PM   #14
SheldonPlankton
Member
 
Registered: Jun 2004
Posts: 129

Rep: Reputation: 15
Ha ... I knew it had to be something like that. Seriouly though if you are doing something important to you BACK IT UP! You don't have to go out there and setup a AMANDA server but you should at least consider CVS.
 
  


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
Fedora Ruined My PC!!!!!!!!!!!! wasabi Fedora 72 01-18-2006 02:44 PM
Cedega ruined my linux.. help!! coolz123 SUSE / openSUSE 2 05-03-2005 07:49 AM
SP2 ruined my life...help kbz2007 General 3 09-14-2004 05:32 AM
up2date ruined my system philF Fedora 15 06-11-2004 09:38 AM
Ruined my font-system? mcsmurf Linux - Software 0 10-12-2003 03:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:38 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