Quote:
Originally posted by Fallon
Well, I need to be able to move the folder within the program. So forking it isn't really that good of an idea I suppose...
|
That was my point. If your program goes like this:
- prompt user for something
- move files
- display success message
- prompt user for something
and you use any of the exec() family of functions, your program will work like this:
- prompt user for something
- move files
- terminate
That is because the current process image of YOUR program is overwritten by the 'mv' process image. You need to fork to create an exact duplicate copy of your process, and immediatly replace one of them with the mv exec:
PHP Code:
if(fork()){
execvp(...);
}
continue program here