Re: background process on windows 2000
sunil matte wrote: hi i am trying to start a detached process in perl. I am building a web based application,where a user queries the database on my server.the query triggers an agent that updates the database. i want the agent to be a back ground process so that the user should not be left waiting for it to complete.can some one suggest how i can achieve this. i also need to send the query entered by the user to the back ground process.it would be helpfull if any one of you guys provide a sample code that would do the job or help me find it... Look at Win32::Process (Create function). If you have trouble figuring it out, repost with a failing snippet. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /-- o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/__/_/_ Castle of Medieval Myth Magic http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Re: background process on windows 2000
A .dll would probably be more efficient than leaving a process executing in the background, or even a stored procedure... It has been my experience that any process left hanging ~might~ leave a potential hole open to intrusion... Mark - Original Message - From: $Bill Luebkert [EMAIL PROTECTED] To: sunil matte [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: 30 November, 2001 4:28 PM Subject: Re: background process on windows 2000 sunil matte wrote: hi i am trying to start a detached process in perl. I am building a web based application,where a user queries the database on my server.the query triggers an agent that updates the database. i want the agent to be a back ground process so that the user should not be left waiting for it to complete.can some one suggest how i can achieve this. i also need to send the query entered by the user to the back ground process.it would be helpfull if any one of you guys provide a sample code that would do the job or help me find it... Look at Win32::Process (Create function). If you have trouble figuring it out, repost with a failing snippet. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /-- o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/__/_/_ Castle of Medieval Myth Magic http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Re: background process on windows 2000
I had a similar situation, didn't really like Win32::Process, fork didn't work, I don't think it does outside of Unix, either one seems complicated to me. Instead I just wrote the data to a queue in a file and had another 'background' process pollthe file every 10 seconds to see if there was a job to do, wasn't complicated that way. - Original Message - From: $Bill Luebkert To: sunil matte Cc: [EMAIL PROTECTED] Sent: Friday, November 30, 2001 4:28 PM Subject: Re: background process on windows 2000 sunil matte wrote: hi i am trying to start a detached process in perl. I am building a web based application,where a user queries the database on my server.the query triggers an agent that updates the database. i want the agent to be a back ground process so that the user should not be left waiting for it to complete.can some one suggest how i can achieve this. i also need to send the query entered by the user to the back ground process.it would be helpfull if any one of you guys provide a sample code that would do the job or help me find it...Look at Win32::Process (Create function). If you have troublefiguring it out, repost with a failing snippet.-- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /-- o // // http://dbecoll.tripod.com/ (Free site for Perl)-/-' /___/__/_/_ Castle of Medieval Myth Magic http://www.todbe.com/___Perl-Win32-Users mailing list[EMAIL PROTECTED]http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Re: background process on windows 2000
On 30.11.01 at 18:33 David Edrich wrote: I had a similar situation, didn't really like Win32::Process, fork didn't work, I don't think it does outside of Unix, either one seems complicated to me. Instead I just wrote the data to a queue in a file and had another 'background' process poll the file every 10 seconds to see if there was a job to do, wasn't complicated that way. What does your 'background' process look like? I want to run several ChangeNotify routines and each one requires a seperate process per directory to be monitored. Marcus ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
RE: Background
From: Christopher Hahn [EMAIL PROTECTED] Subject: Background I have successfully use the Proc::Background module to run an NT batch file in the bacground. However, the bat file's standard out is still spewed at the command line. Additionally, this bat file has pauses that require input. I want to redirect I'm not familiar with Proc::Background, running the command shell with the batch file as a parameter works on my system. You can start it using either "win32:process::create or by running the start command from system. For example: Batch file c:\a.bat cat c:\autoexec.bat echo this is line 2 of a.bat pause echo this is line 2 of a.bat Perl script: use Win32::Process; print "line1\n"; my $shell= $ENV{'COMSPEC'}; system "start /B $shell /c c:\\a.bat nul c.txt"; print "line2\n"; Win32::Process::Create($ProcessObj, $shell, "$shell /c c:\\a.bat nul d.txt", 0, NORMAL_PRIORITY_CLASS, "c:\\")|| die "process create failed"; print "line3\n" works for me, and puts the output from the script (including the output from cat) to c.txt and d.txt. ("Cat" is a port of the GNU cat, which just lists a file.) ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users