Very Expensive Typo
gcc -o myprogram myprogram.c
./myprogram ...errors at blah blah line numbers ... ...fix those errors... rm myprogram gcc -o myprogram myprogram.c ./myprogram ....errors at blah blah line numbers... . . . ...(hours of this later)... rm myprogram.c gcc -o myprogram myprogram.c No such file or directory FUUUUUUUU |
Re: Very Expensive Typo
rip source code
|
Re: Very Expensive Typo
Messed up
|
Re: Very Expensive Typo
Why aren't you using a makefile so this kind of thing doesn't happen, lmfao. Even if you only have one source file, it is a good habit to get into.
|
Re: Very Expensive Typo
Quote:
I dunno -- I get sloppy sometimes when I'm just trying to throw something together. Finished what I was doing, but that oops did set me back a bit. :-P |
Re: Very Expensive Typo
I'm confused what you were trying to type in the first place that was similar to "rm".
|
Re: Very Expensive Typo
Quote:
the .c on the end was. Basically- compile code, test executable, fix code, delete executable, compile code,etc.. Except one time an accidental delete source. |
Re: Very Expensive Typo
But wouldn't recompiling already overwrite the preexisting executable?
|
Re: Very Expensive Typo
Quote:
I'm very thorough, but sometimes a bit too thorough. While this over-thoroughness bit me here, it is quite handy for things like finding and fixing bugs though. |
Re: Very Expensive Typo
Why didn't you use the up arrow (or similar) to copy the command you previously used? That should make it very hard to make a mistake like this.
|
Re: Very Expensive Typo
Quote:
Again, more force of habit. I would be issuing other commands in the between time and don't really feel like sifting 5 to 10 commands back to find what I want when it's easy enough to just type it out. That said, costly typo. :-P One other thing I could do though to avoid this particular problem in the future is just allow the default name of a.out for the executable, for testing purposes, and only rename it once finished. It'd be pretty hard to accidentally delete a source code file that looks nothing like "a.out" and if I tried to remove a.out.c that file wouldn't exist and wouldn't matter. |
Re: Very Expensive Typo
The thing about makefiles is that you can just make a template one that is universal for simple directory structures (i.e. everything is in the same directory as the makefile). It isn't a big deal to just reuse it, just change GCC args and whatnot. Also, in your makefile, you can add a label to delete all object files, so you can do something like this:
make make clean If you don't want to set up source control, you could just work out of Dropbox. That way, you have rudimentary housekeeping, should you make this mistake again. |
Re: Very Expensive Typo
I email myself code periodically. #ghettolyfe
|
Re: Very Expensive Typo
Check your recycle bin :twisted:
|
Re: Very Expensive Typo
oh u..........
|
Re: Very Expensive Typo
this reminds me of Toy Story 2
http://www.techdirt.com/articles/201...e-backup.shtml |
All times are GMT -5. The time now is 08:45 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution