terminating this
hi all
how can i kill this application by programatically am trying like this int main() { system("sudo ruby /root/Desktop/ruby/example.rb"); printf("before sleep"); sleep(5); system("exit"); printf("after sleep"); } it is not terminating. i think control will be at system("sudo ruby /root/Desktop/ruby/example.rb"); here. is there any ruby code to terminate this in programatically can show me the way please. thank you |
I'm not sure exactly what you're asking, but system("exit") does not do what you think it does. All it does is exit from that system() call.
What you want to do instead of the system("exit") is this: exit(0); Hope this helps. |
All times are GMT -5. The time now is 08:04 PM. |