On Fri, 30 May 2003, Mark Calleja wrote: > G'day All, > > I'm trying to daemonize a perl app under Windows but without much joy. Under > a *nix OS I have no such problems, as the following bit of code does the > trick: > > ############ > use POSIX; > > $pid = fork; > exit if ($pid); > die "Couldn't fork: $!" unless defined ($pid); > POSIX::setsid() or die "Can't start new session: $!"; > ############ > > One then simply starts the job from the command line which forks off the > child into the background leaving the parent to exit gracefully. > Unfortunately ActivePerl does not implement setsid, leaving me in a pickle. > I suppose my ignorance of Perl+Windows is showing here, but can anyone > suggest a solution/workaround? >
It's not that perl doesn't implement setsid. It can't. Windows doesn't implement setsid. Generally perl can only provide system-level functionality if the underlying OS provides it and also provides a hook into it. **** [EMAIL PROTECTED] <Carl Jolley> **** All opinions are my own and not necessarily those of my employer **** _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs