in reply to Forking in a CGI program on Windows systems

Okay. I think I solved the problem. Turns out fork works fine on at least Windows 2000 systems. I get the web server to output the web page as soon as I close STDIN, STDOUT, and STDERR in the parent process and the child process.

If anyone needs to see the actual code please let me know. Thanks to everyone for help!

  • Comment on Re: Forking in a CGI program on Windows systems

Replies are listed 'Best First'.
Re: Re: Forking in a CGI program on Windows systems
by rodnic (Initiate) on Nov 03, 2003 at 22:51 UTC
    Hey relax99,
    I was wondering if you would post the code. Here is the code that I'm trying and I'm not able to have my page redirect right away. It still waits until the other process is finished to redirect.
    Thanks for your help!
    if (my $pid = fork)
    {
    	print redirect("buildlist.php");
    }
    elsif (defined $pid)
    {
    close(STDIN);
    close(STDOUT);
    close(STDERR);
    #open STDIN, "</dev/null";
    #open STDOUT, ">/dev/null";
    
    sleep (10);
    open (FILE, "> test.txt");
    print FILE "TESTING CAPABILITY";
    close FILE;
    exit;
    }