Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: How do I start a long process with a short visit to a URL?

by Tanktalus (Canon)
on Oct 07, 2009 at 23:03 UTC ( #799833=note: print w/replies, xml ) Need Help??

in reply to How do I start a long process with a short visit to a URL?

Something like this:

if (fork() == 0) { close STDIN; close STDOUT; close STDERR; do_long_running_thing(); exit 0; } print_out_web_response();
Now, granted, I missed a bunch of error conditions around fork, as well as omitting the Highlander Maneuver, but that's the basic idea.

Note that you can reopen stdout and/or stderr and redirect them to a file, or you can pipe them into something that'll send you an email, whatever you want. If nothing else, you may want to reopen to /dev/null, just to sure you don't confuse subprocesses if you call any.

Replies are listed 'Best First'.
Re^2: How do I start a long process with a short visit to a URL?
by ikegami (Pope) on Oct 07, 2009 at 23:58 UTC
    The details you say you don't handle? The module I mentioned does. It does the STDOUT/STDERR redirecting too if you wish.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://799833]
[jedikaiti]: Hi Monks
[GrandFather]: HI jedikaiti. Collected more 73p data this morning. Rubbish sky though. Seeing was between 5 and 9 arc seconds FWHM with thin cloud drifting through :(
[GrandFather]: Still, at least some of the images are good enough to get reasonable astrometry. Well, good enough for a good plate solve anyway

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-02-20 20:50 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (302 votes). Check out past polls.