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
Solved

source code's lost

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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 video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 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