Solved

source code's lost

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 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