I want to add a feature to one of my programs where if I create a specific file it will then finish, tidy up, then restart itself. This will be used when publishing a change to live so I can force it to rerun with new changes. Just to add a bit more automation into the process.
Linux allows you to overwrite an exe of a currently running program as it loads it into memory and there's no concept of "in use" so I will use this to my advantage. Replace program, create the file that tells it to restart, then it will restart and run the new exe.
I'm thinking of just using a system() call with &. Will that work ok or is there a better way?
Linux allows you to overwrite an exe of a currently running program as it loads it into memory and there's no concept of "in use" so I will use this to my advantage. Replace program, create the file that tells it to restart, then it will restart and run the new exe.
I'm thinking of just using a system() call with &. Will that work ok or is there a better way?