Purpose : to create a progress bar in which users can check how many files were downloaded by my server.
The script . I have a PHP script that runs a python script through popen. I did it like this:
$handle = popen('python last', 'r'); $read = fread($handle, 4096); pclose($handle);
This python script outputs something like this to the shell:
[last] ZVZX-W3vo9I: Downloading video webpage [last] ZVZX-W3vo9I: Extracting video information [download] Destination: myvideo.flv [download] 9.9% of 10.09M at 3.30M/s ETA 00:02
Problem . When I read the file generated by shell output, I get all shell output except the last line !? Why?
Just add, when I run the command through the shell, the shell cursor appears at the end of this line and waits until the script is executed.
Thank you all
source share