July 16th, 2004 11:33 AM
Please help - source file recovery - deleted by gcc?
Hey guys, I really need your help here. I was working on a C program for a couple of days, but today the source disappeared. I was compiling the program using the gcc that came with cygwin, and I accidentally input the wrong command:
gcc -o program.c program
gcc -o program program.c
As far as I can tell, the people who coded gcc didn't think to put in failsafes that prevent the first file from being deleted if the second file isn't found. Not only is the source gone, but when I try and use Restorer2000 or FinalRecovery to get it back, the deleted file they come up with has a zero byte file size. I guess that means that gcc overwrote it too? Argh!
Does anyone know what I can do? I've barely done anything on that drive since then. I worked really hard on this program, and my last backup was that morning before I made a lot of radical changes. Maybe somebody can recommend a more useful undelete type program. Thanks in advance...
July 16th, 2004 01:58 PM
gcc just didnt delete source, it zeroed the source. so you cant recover on a windows structure.
it opens output file and then input file. its gone.
an idea: write a .bat file and use it to avoid this kind of mistake.... (its pretty common. i lost files on that way too)
FORMAT C: Yes ...Yes??? ...Nooooo!!! ^C ^C ^C ^C ^C
If I die before I sleep, I pray the Lord my soul to encrypt.
If I die before I wake, I pray the Lord my soul to brake.
July 18th, 2004 02:18 AM
Argh. Well, thank you! I don't know why they would code it that way though, or why programmers just shrug and accept it. You would think that something like that would be high up there on the list of things to fix before people get angry. It wouldn't take much work to check and make sure that both arguments are valid first. Oh well.
It only took me an hour to rewrite the program. Not that it was terribly simple, but it must have taken a lot of thinking as opposed to writing the first time. ^.x
July 18th, 2004 04:50 AM
Learn how to use make
I came in to the world with nothing. I still have most of it.