in reply to Re^2: Interacting with the shell ( backticks, system(), open -| )
in thread Interacting with the shell ( backticks, system(), open -| )
So piping the command to a filehandle should keep the find . -ls process open until <FP> is closed?
The external process is connected to your end of the pipe via one or two buffers, usually 4k or 8k each.
When (if) those buffers fill up, the external process will be blocked when trying to add more output to the pipe and thus will have to wait until your program reads some of the data from your end of the pipe before continuing.
If the external program produces less output than the combined size of the buffers, it will run to completion immediately and the output will wait in the pipe until your program reads it.
|
|---|