Yeah, I just meant "a background task"...
I had a look at Proc::Daemon, but it does not seem to run under Windows. However, I would be very grateful if such a module existed for Windows.
Kind regards
| [reply] |
P:\test>start /b perl -le"open LOG, '>', 'my.log';
select LOG;
$|=1;
print ~~localtime while sleep 10" 1>nul 2>&1 <nul
P:\test>u:tail -f my.log
Tue Sep 14 12:11:10 2004
Tue Sep 14 12:11:20 2004
^C
The "one-liner" (here split across multiple lines to avoid wrapping) could be just about any perl script you like. It runs in the background, has it's STDIN, STOUT and STDERR redirected to the nul device and will continue to run until terminated through the task manager or other mechanism.
Proc::Daemon does a couple of other things--changing the umask (whatever that is) etc.-- but nothing that you cannot easily do yourself.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
| [reply] [d/l] |
In fact my problem was that I was not aware of the windows 'start' command. As I said, I'm a Windows newbie ;)
Many thanks !
| [reply] |
In fact, your solution does not fully fit my needs : if I try to exit from the windows that was used to launch the 'start' command, it hangs. And if I close that windows 'by force', the perl script does not run any longer.
So that's not a real daemon behaviour, because I do not want a window to be attached to the program.
Any hint ?
| [reply] |