06-1-2013, 08:20 PM | #1 |
FFR Veteran
|
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 |
06-2-2013, 01:40 AM | #2 |
new hand moves = dab
Join Date: Dec 2002
Location: he/they
Age: 33
Posts: 10,094
|
Re: Very Expensive Typo
rip source code
|
06-2-2013, 01:43 AM | #3 |
FFR Veteran
Join Date: Sep 2009
Age: 32
Posts: 674
|
Re: Very Expensive Typo
Messed up
__________________
|
06-2-2013, 01:46 AM | #4 |
FFR Player
|
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.
__________________
|
06-2-2013, 02:06 AM | #5 | |
FFR Veteran
|
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 |
|
06-2-2013, 03:31 AM | #6 |
Snek
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
|
Re: Very Expensive Typo
I'm confused what you were trying to type in the first place that was similar to "rm".
|
06-2-2013, 04:29 AM | #7 | |
FFR Veteran
|
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. |
|
06-2-2013, 04:58 AM | #8 |
Snek
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
|
Re: Very Expensive Typo
But wouldn't recompiling already overwrite the preexisting executable?
|
06-2-2013, 06:08 AM | #9 | |
FFR Veteran
|
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. |
|
06-2-2013, 10:32 AM | #10 |
stepmania archaeologist
Join Date: Aug 2005
Age: 34
Posts: 4,090
|
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.
__________________
Best AAA: Policy In The Sky [Oni] (81) Best SDG: PANTS (86) Best FC: Future Invasion (93) |
06-2-2013, 07:39 PM | #11 | |
FFR Veteran
|
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. |
|
06-3-2013, 12:52 AM | #12 |
FFR Player
|
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.
__________________
Last edited by FissionMailed1; 06-3-2013 at 12:56 AM.. |
06-3-2013, 01:19 AM | #13 |
new hand moves = dab
Join Date: Dec 2002
Location: he/they
Age: 33
Posts: 10,094
|
Re: Very Expensive Typo
I email myself code periodically. #ghettolyfe
|
06-6-2013, 09:04 PM | #14 |
I am leonid
Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
|
Re: Very Expensive Typo
Check your recycle bin :twisted:
|
06-7-2013, 08:49 AM | #15 |
new hand moves = dab
Join Date: Dec 2002
Location: he/they
Age: 33
Posts: 10,094
|
Re: Very Expensive Typo
oh u..........
|
06-7-2013, 08:52 AM | #16 |
Celestial Harbor
|
Re: Very Expensive Typo
this reminds me of Toy Story 2
http://www.techdirt.com/articles/201...e-backup.shtml |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|