> Aleksandar Donev wrote:
>
> > Sorry I forgot to say this important information: I am using the Intel
> > compiler on Linux x86_64 (I assume in the end the actual linking is done by
> > ld). I tested and recompiling an executable (even after changing it so the
> > size of the executable changes) keeps the same inode (Linux's internal file
> > id as obtained via "ls -i"), so it does seem like the executable is
> > overwritten in-place. I would have still expected the OS to be wise enough to
> > protect running jobs from seing any changes but it doesn't seem that way.
> > Thanks,
> > Aleks
If the executable is already running and you want to recompile a new
executable at the same path, then just rename the existing executable:
mv prog.exe prog.exe.save
This merely changes the directory entry and doesn't interfere with the
running job, but the new executable will be written to a new prog.exe.
Once any running jobs have finished you can delete prog.exe.save.
Anthony
|