Answer the question
In order to leave comments, you need to log in
Is it possible to create a completely independent process from a program?
____ It makes sense to think towards creating independent processes from a C++ program. Suppose, on Linux, the fork / exec strategy produces a copy of the current process, and upon completion of the main one, the copy continues to work, but the condition of an absolutely independent process is not reached, i.e. when fork-e, the main program is copied and the handler of the executable file is not released, what needs to be achieved. Does it make sense to look in this direction? Those. is there any solution to this problem, for example, by launching a process independent from the main program ... inside which to change the executable file of the main program via ofstream or echo "test" >> prog .
____ Interested in the same solution, but also on Windows .
Conclusionecho "data" >>
1625992443.sh: 1: 1625992443.sh: cannot create bin/Release/licenses: Text file busy
Answer the question
In order to leave comments, you need to log in
Linux does not allow you to change the file of a running program because it is not always loaded into RAM completely, but can be read from disk at different points in the program's execution.
Direct answer to your question:
fork-e copies the main program and does not release the handler of the executable file, which must be achieved
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question