Results 1 to 4 of 4

Thread: Please help - source file recovery - deleted by gcc?

  1. #1
    Junior Member
    Join Date
    Jul 2004

    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

    instead of

    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...

  2. #2
    Senior Member
    Join Date
    Apr 2004
    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)
    Meu sítio

    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.

  3. #3
    Junior Member
    Join Date
    Jul 2004
    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

  4. #4
    AO Curmudgeon rcgreen's Avatar
    Join Date
    Nov 2001
    Learn how to use make
    I came in to the world with nothing. I still have most of it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts