Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Modify program file while running

    Hallo together,

    in advance I apologize for this beginner question :
    I have a C++ program running (foo.ex) and it will need still some days to finish. Now I want to run the same program (foo.ex), but in a modified form, i.e. I want to change some things in the source code and recompile it. My question: is it possible, that the compiling and new execution of the program is doing any 'harm' to my already running process?
    For reasons that are too long to explain, it is not possible to copy the program to another filename, I have to use exactly this executable foo.ex.

    Thank you for your help!


  2. #2
    Linux Engineer
    Join Date
    Jan 2005
    Saint Paul, MN
    Yes, putting a new executable into the same file as a running program is using can cause problems is some cases.

    Yes, you can rename the existing executable (see the command "mv") prior to your compiling and linking the new version.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts