Solved

source code's lost

Posted on 2001-07-11
3
204 Views
Last Modified: 2010-04-21
Aaargh!
I accidently typed:

cc program.c -o program.c

Now the source code IS the program!!!!!!

Any chance to get it back??

Thanks,
Minerva
0
Comment
Question by:Minerva
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6273390
>Any chance to get it back??

Yes, if you have a backup copy, for example on a tape.
But I assume you don't hae it, so the only anwser is:
  No, you cannot restore it, anyhow.

But wait, theoretically there is a minimal chance to restore some parts, but only if you have not written anything else on the harddisk since you issued the cc command:
   use a tool (like dd then pipe it to od) to read the raw disk device and serach for the text. Be careful, 'cause the text may not apear in the sequence you expect it.
0
 
LVL 5

Expert Comment

by:garboua
ID: 6274293
yeah re-write the program, it is much quicker and safer than trying to to read raw disk device, all being considered
0
 
LVL 2

Accepted Solution

by:
curri earned 100 total points
ID: 6283341
If you are using an ext2 filesystem (you probably are) you can try to undelete that file, I guess. There is a how to in linuxdoc.org about how to do it.

Also, there is a chance your text editor does automatic backups. For example, emacs saves a backup copy (the last version before the one you saved) in a file ending in the character ~, and may do autosave (saving every so often :) in files starting with #. Check for your text editor, you may be lucky :)

Orlando
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now