Linux randomly deleted my file while compiling what do I do?

前端 未结 2 1907
我在风中等你
我在风中等你 2021-01-23 01:25
gcc -L/root/Desktop - Wall -o prog3.c -pthread -lcopy
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.0: In function \'_start\': (.text+0x20): undefined          


        
2条回答
  •  孤独总比滥情好
    2021-01-23 01:40

    Little addendum of your options in such scenario:

    1. It was Git (or any other version control) repository. In such case, you can simply bring it from previous commit

    2. Your editor/IDE has some back-up system. Sometimes I need to bring back a file I've thought was needless. For such case, my favourite text editor should have create already back-up file in appropriate location (e.g. $XDG_DATA_HOME/vim/backup in my case).

    If none of above, but you still have previously correctly compiled binary file

    1. You can try to decompile, but this process - even if successful - isn't lossless (e.g. code is basically spaghetti).

    2. Had you compiled with -g flag, you could possibly retrieve the code from debug info.

    3. You can at least de-assemble to Assembly code.

提交回复
热议问题