Solved

source code's lost

Posted on 2001-07-11
3
205 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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

22 Experts available now in Live!

Get 1:1 Help Now