Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

FAQ: Frequently Asked Questions about CGI Programming
Section - 3.8 Can I launch a long process and return a page before it's finished?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Schools ]


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?
See reader questions & answers on this topic! - Help others by sharing your knowledge

[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


User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




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 March 27 2014 @ 02:12 PM