Hello all,
Objective: Make a progress bar where users can check how much of a file has been downloaded by my server.
Scenario:I have a PHP script that executes a python script via popen. I have done this like so:
$handle = popen('python last', 'r');
$read = fread($handle, 4096);
pclose($handle);
This python script outputs to the shell something like this:
[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 in the file generated by the shell output I get all the shell output except the last line!? WHY?
Just to add, when I run the command via the shell, the shell cursor appears at the end of that line and waits till the script is done.
Thanks all