• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

Stupid me GCC'd right over my source

I compiled over the top of my source code and my backup is a day old.  Using GCC on Mac OSX 10.4, i.e.

gcc source.c -o source.c

Any idea how I can get my source back?
0
jchristn123
Asked:
jchristn123
1 Solution
 
fridomCommented:
If you do have you code under some sort of revision control (I doub it) you can replace it with the last checkin. Otherwise you've to start from the backup

Regards
Friedrich
0
 
Infinity08Commented:
Here's a few things to check (in order of "easiness") :

1) Did you use a text editor that takes backups before modifying something (usually something like source.c~ or similar) ?

2) I don't know what file system you use on your Mac OS, but look out for file recovery tools. If you haven't done too much on the disk since the loss, you might be able to recover the file.

3) Just re-write it (assuming there's not too much code that is lost).

4) If all else fails, you have the option of disassembling the object file (in your case source.c since that's what you saved it as). Depending on the level of optimizations, and debugging options, you can get quite a lot out of it. However, typically, you won't get the exact source.
0
 
jchristn123Author Commented:
I re-wrote it, and learned a valuable lesson.  Use makefiles and make instead of GCC on the command line.  Thanks infinity
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now