in reply to Interacting with the shell ( backticks, system(), open -| )
What is the advantage of using open FP, "find . -ls |" and then looping through the handle, as opposed to using backticks?
Once you found what you are looking for, you can discard the rest.
If you capture the pid returned by the piped open, you can even kill the external process before it completes.
regarding system(), it returns the exact same thing as using backticks
What makes you think this? system does not capture or return any output from the program.
why did the coder use a pipe in open() instead of using backticks ...?
Perhaps he was dealing with very large directories.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Interacting with the shell ( backticks, system(), open -| )
by jktstance (Novice) on Feb 05, 2014 at 15:00 UTC | |
by BrowserUk (Patriarch) on Feb 05, 2014 at 15:18 UTC |