Skip to content
Prev 247401 / 398503 Next

How to *completely* stop a script after stop()?

----------------------------------------
you can laugh about it but I actually have had to write code like
this in interactive applications ( I guess you could laugh at me too LOL)
and sometimes you need it but sometimes it makes things worse. Of course,
normally you would use something like a try/catch for exceptional
conditions but even her it is not always easy to remember to 
close all the resources and in multithreaded code it becomes
even more complex ( there used to be a way in java to stop a thread
but this was removed due to it being inherently unsafe.). 

I've run into this with ctrl-C, my sacred stop all seems to kill R and
leave R term or something so cygwin ends up sending some commands
to bash and some to R until I kill Rterm in task manager. I always
assume I have ctrl-C in my script based data analysis as you really
can't always know how long you want things to go in with exploratory
work ( put ctrl-C in a prespecified analysis plan and see how that goes
over LOL).