It still seems odd to me that the code called by exec() runs basically instantly while using backticks it literally takes several minutes to complete the task and print the output. There must be something I'm overlooking.
From what you said, it sounds like backticks actually use the exec() function -- unless you meant something else. Is that the case?
"the two programs aren't at all equivalent, since a successful call to exec() never returns. (You probably know that, but still)."
Yeah, I was aware of that, and that's one of the reasons I tried the backticks first (in case I ended up doing more after running the shell command). It looks like I'll just have to make sure running that command is the absolute last thing the script does, unless I want to either write a lot more code to get the same result as intended with backticks (but faster) or suffer some really unacceptable performance lags on a simple admin script.
|
- apotheon
CopyWrite Chad Perrin |
In reply to Re^2: exec vs. backtick-and-assign performance
by apotheon
in thread exec vs. backtick-and-assign performance
by apotheon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |