Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

source code's lost

Posted on 2001-07-11
3
Medium Priority
?
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 400 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

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

705 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