[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Single Page

Top Document: FAQ: Frequently Asked Questions about CGI Programming
Previous Document: 3.7 Can I trace where a user has come from/is going to?
Next Document: 3.9 Can I launch a long process which the user interacts with?


3.8 Can I launch a long process and return a page before it's finished?



[UNIX]
You have to fork/spawn the long-running process.
The important thing to remember is to close all its file descriptors;
otherwise nothing will be returned to the browser until it's finished.
The standard trick to accomplish this is redirection to/from /dev/null:

        "long_process < /dev/null > /dev/null 2>&1 &"
        print HTML page as usual




Top Document: FAQ: Frequently Asked Questions about CGI Programming
Previous Document: 3.7 Can I trace where a user has come from/is going to?
Next Document: 3.9 Can I launch a long process which the user interacts with?

Single Page


[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
Nick Kew <nick@webthing.com>

Last Update October 22 2009 @ 05:36 AM

Some parts © 2009 Advameg, Inc.