Your approach does not work because you have structured your program in a way that it collects all information before it starts printing the output.
The standard approach for running long processes is Watching Long Processes Through CGI, which you can adapt to your needs by launching an external program which writes to a file.
In reply to Re: Asynchronous Processing a command execution
by Corion
in thread Asynchronous Processing a command execution
by Alfaromeo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |