in reply to Re^4: Running CGI script within another cgi script
in thread Running CGI script within another cgi script

Generally looks okay to me... except for the print redirect('http://localhost/test.html'); which would redirect without delay, so that the browser would request the output page more or less immediately, when it hasn't been written yet completely (I'm supposing the test.html is being produced by function_call(), as you mentioned before).

This would either lead to partial/premature content being returned, or - more likely on Windows (AFAIK, the file would be locked by the writing process) - the webserver would not be allowed to read it at all, before the long-running process has finished writing the file...   Why not stick with the http-equiv="refresh" (with a delay) that you had tried originally?

BTW, are you sure it's the original request that hangs, or is it the new redirected one?

Replies are listed 'Best First'.
Re^6: Running CGI script within another cgi script
by Anonymous Monk on Nov 28, 2009 at 07:52 UTC
    Hi almut,

    Thanks again for your reply on this. To explain properly...below is what happening:

    Actually it supposed to do 1.redirect to test.html 2.execute the function call in chile thread 3. Write down the final result to a tmp file 4. rename the tmp file to test.html

    Instead of this it's behaving like 1.*Not* redirecting to test.html 2.executing the function call successfully. 3.creating and writing the final result to tmop file properly 4.*Not renaming* the tmp file and after some time getting expired.

    any clue what I am doping wrong again?Thanks

Re^6: Running CGI script within another cgi script
by Anonymous Monk on Nov 28, 2009 at 08:03 UTC

    also, the test.html file is getting generated after the function-call. Means, function-call is not generating the html file.

    after the function completes, it carries out some more process and then the final result gets written ....

      I tried with http-equiv but this time though everything goes fine but when renaming it's erroring saying (The process cannot access the file because it is being used by another process.). I given a delay of 50 seconds.