.
>
> I ALREADY HAVE some code that does this (see below). My question is- is
> there a way to periodically poll the outside process to determine if it
> is still running? I've tried a few things already and none of them
> work.
>
> ===== the code ==
(defined $process) {
if ($process->GetExitCode() == Win32::Process::STILL_ACTIVE()) {
# process is still running
...
}
else {
# process has terminated; PID is still valid
...
# release process handle so the OS can do full cleanup
# of the alread
question is- is
there a way to periodically poll the outside process to determine if it
is still running? I've tried a few things already and none of them work.
= the code =
use strict;
use warnings;
use Win32::Process;
# Parameters for the Win32::Proc
ActiveState.com
Subject: Win32::Process Help Needed - Main Process Exits While Children Run
I have a piece of code that has been running for a number of years, until now.
My vendor changed the way they created a program,
and that new program exits before its children's processes are fin
ogFullPath = "c:\\temp\\foobar.exe";# Not the real program
my $commandLine = "foobar opt1 opt2"; # Again, just an example
my $ProcessObj;
Win32::Process::Create($ProcessObj,
$progFullPath,
$commandLine,
0,
NORMAL_PRIORITY_CLASS,
&q
want it to run for a certain amount of time and
> then kill it. For instance a little snippet that shows a PowerPoint
> slide for 15 seconds
>
> Win32::Process::Create($goodfile,
>"c:\\progra~1\\microsoft office\\powerpoint viewer\\PPTVIEW.EXE",
>
Jan Dubois wrote:
>
> If you need to wait for your subprocesses, then you may want
> to use this somewhat obscure form:
>
> my $pid = system(1, $cmdline);
> # ...
> waitpid $pid, 0;
>
> (This is documented in `perldoc perlport` as a Win32 specific extension
> to system(), but not me
a little snippet that shows a PowerPoint
slide for 15 seconds
Win32::Process::Create($goodfile,
"c:\\progra~1\\microsoft office\\powerpoint viewer\\PPTVIEW.EXE",
"PPTVIEW.EXE \"$goodfile\" /s",
0,
NORMAL_PRIORITY_CLASS,
"
; # SW_MINIMIZE
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Michael Ellery
Sent: Monday, April 28, 2008 3:24 PM
To: 'perl-win32-users'
Subject: Win32::Process::Create
..I use this function pretty regularly to spawn procs on windows, but
I'v
ere is a STARTUPINFO structure that allows this, but looks like
> it's not part of the Win32::Process API. Advice appreciated.
You cannot do this currently with Win32::Process, so you may want
to file an enhancement request at
http://rt.cpan.org/Public/Dist/Display.html?Name=Win32-Pr
Sisyphus wrote:
>
> What happens if you launch the script using the wperl executable instead
> of the perl executable ?
>
I don't even know what wperl is, although it does look like it's part of
my current perl install (I have never heard of it before now). In any
event, it's not an option f
- Original Message -
From: "Michael Ellery" <[EMAIL PROTECTED]>
To: "'perl-win32-users'"
Sent: Tuesday, April 29, 2008 5:24 AM
Subject: Win32::Process::Create
> ..I use this function pretty regularly to spawn procs on windows, but
> I'
s not part of the Win32::Process API. Advice appreciated.
-Mike Ellery
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
eally test it. I will send the mess of a script (I
> tend to write
> really rambling garbage with the hope of cleaning it up some day and rarely
> do) to anyone
> who does want to install the required program etc.
>
> Win32::Proces
. to really test it. I will send the mess of a script (I tend
to write
really rambling garbage with the hope of cleaning it up some day and rarely do)
to anyone
who does want to install the required program etc.
Win32::Process::Create( my $process
(), because I need to set a variable before I launch the
application. I can execute multiple commands in System().
Ted zeng
On 11/2/05 12:29 PM, "$Bill Luebkert" <[EMAIL PROTECTED]> wrote:
> Ted Zeng wrote:
>
>> Hi,
>>
>> I launch (use Win32::Process) an app
Ted Zeng wrote:
> Hi,
>
> I launch (use Win32::Process) an application as a detached process from
> a service. And I got
> The exit code is 3221225477.
> What does it mean?
That error is a C005 which equates to: STATUS_ACCESS_VIOLATION
Link may help explain or search M$
Title: Question on exit code of Win32::Process
Hi,
I launch (use Win32::Process) an application as a detached process from a service. And I got
The exit code is 3221225477.
What does it mean?
The application is supposed to run. But it just launches and quit right away (I can see it from task
Allegakoen, Justin Devanandan wrote:
> --8<
>
>># no warnings;
>>next if $This =~ /\.pl$/;
>
>
> The above should be 'return' rather than 'next'.
> --8<
> Why didn't I think of that?
>
> --8<
> Where is your description of the err
--8<
> # no warnings;
> next if $This =~ /\.pl$/;
The above should be 'return' rather than 'next'.
--8<
Why didn't I think of that?
--8<
Where is your description of the error ?
--8<
I supplied the smallest failing s
Allegakoen, Justin Devanandan wrote:
> -8<--
> It seems to me that when you get a warning, you're doing something wrong
> or it wasn't coded to take all possibilities into consideration - so I
> never turn off warnings or strict. I already found two legit bugs in
> that
> module, so I'
-8<--
It seems to me that when you get a warning, you're doing something wrong
or it wasn't coded to take all possibilities into consideration - so I
never turn off warnings or strict. I already found two legit bugs in
that
module, so I'm guessing there are more to find.
-8<
>It seems to me that when you get a warning, you're doing something wrong
>or it wasn't coded to take all possibilities into consideration - so I
>never turn off warnings or strict. I already found two legit bugs in that
>module, so I'm guessing there are more to find.
I agree about the warnings.
Alejandro Santillan Iturres wrote:
>>It seems to me that when you get a warning, you're doing something wrong
>>or it wasn't coded to take all possibilities into consideration - so I
>>never turn off warnings or strict. I already found two legit bugs in that
>>module, so I'm guessing there are mor
Sisyphus wrote:
> Generally, imho, it is better to remove the "bugs" (used equally, if not
> more, loosely).
>
> Maybe that's what the op wants to do or maybe he just wants to suppress
> those particular warnings. It's not entirely clear to me. If he wants to
> remove the "bugs" he'll take n
- Original Message -
From: "$Bill Luebkert" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, August 31, 2005 4:21 PM
Subject: Re: warning messages on module Win32::Process::Memory
> Sisyphus wrote:
>
> > Those warnings are all generated by Memory.pm - you could sp
Sisyphus wrote:
> Those warnings are all generated by Memory.pm - you could specify 'no
> warnings' near the start of Memory.pm (or just comment out 'use warnings;'
> in Memory.pm) and all warnings produced by Memory.pm will then be not seen.
> (Warnings produced by your script will be unaffecte
- Original Message -
From: "Alejandro Santillan Iturres"
>
> And the error messages are ( a LOT of those, maybe 20 times the messages I
> quote):
>
>
> Use of uninitialized value in sprintf at
> C:/Perl/site/lib/Win32/Process/Memory.p
> m line 94.
>
Alejandro Santillan Iturres wrote:
> Bill, this is the snippet I am using:
>
> use strict;
> use warnings;
> use Win32::Process::Memory;
>
> my $line="";
> my $proc = Win32::Process::Memory->new({ name=>'Trademaven.exe' }) or die;
>
> m
Bill, this is the snippet I am using:
use strict;
use warnings;
use Win32::Process::Memory;
my $line="";
my $proc = Win32::Process::Memory->new({ name=>'Trademaven.exe' }) or die;
my %memlist = $proc->get_memlist;
foreach (sort { $a <=> $b } keys %memlist)
Alejandro Santillan Iturres wrote:
> When using the module Win32::Process::Memory under windows I get a LOT
> of warning messages like:
>
>
> "Use of uninitialized value in sprintf at
> C:/Perl/site/lib/Win32/Process/Memory.p
> m line 94.
> substr outside of str
When using the module Win32::Process::Memory under windows I get a LOT of
warning messages like:
"Use of uninitialized value in sprintf at
C:/Perl/site/lib/Win32/Process/Memory.pm line 94.substr outside of
string at C:/Perl/site/lib/Win32/Process/Memory.pm line 94.substr outsi
- Original Message -
From: "Stefan Müller" <[EMAIL PROTECTED]>
To:
Sent: Sunday, April 24, 2005 7:36 PM
Subject: Win32::Process Kill Process in Windows ME
> Hello,
>
> I want to kill a Process in Windows ME, which I have
> started. I have
> executed t
Hello,
I want to kill a Process in Windows ME, which I have
started. I have
executed the following lines in XP and it works. I
execute this in ME,
the process starts but it won't be killed. I tried
different function calls.
Win32::Process::Create($ProcessObj,
"C
notify me when the first child ends so I don't have to keep polling them
> both. But since the forked child in Perl on Windows apparently does not send
> a SIGCHLD when it ends, that method seems to be out.
>
> If I use Win32::Process to create the children, I can't use Wait
keep polling them both. But since
the forked child in Perl on Windows apparently does not send a SIGCHLD when it
ends, that method seems to be out.
If I use Win32::Process to create the children, I can't use Wait(). Wait()
blocks, so I can only wait for one of the children and I don't
This works perfectly on my system (XP Pro SP2, 5.8.6) - starts and kills
the ping process. The sleeps are so you can watch with task
manager/pslist. Can you confirm whether it works on yours?
Paul
use Win32::Process;
my $ProcessObj;
Win32::Process::Create($ProcessObj,
"$ENV{SYSTE
[EMAIL PROTECTED] wrote:
I'm trying to use Win32::Process to run an external program asynchronously while I run a countdown timer in the main program. If the timer runs out, I want to kill the other program/process. I am able to create the second process fine, my program continues to the
> I'm trying to use Win32::Process to run an external program asynchronously
> while I run a countdown timer in the main program. If the timer runs out, I
> want
> to kill the other program/process. I am able to create the second process
> fine,
> my program continues to
I'm trying to use Win32::Process to run an external program asynchronously
while I run a countdown timer in the main program. If the timer runs out, I
want to kill the other program/process. I am able to create the second process
fine, my program continues to the timer, but when the
[EMAIL PROTECTED] wrote:
[snip]
>
Does anyone know how to monitor memory usage in perl, that is cheap on cpu and
>
works on all windows versions (eg. win95 and newer)
>
If you're to using win32 api, one way to do it is to use PDH library to retrive
the relevant performance coutner.
Hi all,
Does anyone know how to monitor memory usage in perl, that is cheap on cpu and
works on all windows versions (eg. win95 and newer)
Basically i have this background perl process, that continues to eat up memory.
my plan for managing it would be
if currentmemoryusage > myspecifiedlimi
s,
worth a look.
P.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: 03 December 2004 20:46
To: Perl-Win32
Cc: [EMAIL PROTECTED]
Subject: Win32 process auto-restart on error/crash or kill
Hi all,
how do i automatically get a script to res
[EMAIL PROTECTED] wrote:
> Hi all,
>
> how do i automatically get a script to restart itself on error/crash
> or kill?
>
> I tried $SIG{INT}, but that only works with Ctrl-C, in a console.
>
> Lets say i were to kill the process using the Task Manager ("end
> process"). How do I get the script
Hi all,
how do i automatically get a script to restart itself on error/crash or kill?
I tried $SIG{INT}, but that only works with Ctrl-C, in a console.
Lets say i were to kill the process using the Task Manager ("end process"). How
do I get the script to automatically restart?
Thanks in advanc
Leroy G. Blimegger Jr. wrote:
> All,
>
> Has anyone used the Win32::Process::Info package? I'm trying to determine
> which processes are running on a machine. I can get all of the PIDS, but I’m
> having difficulty getting the PID info:
>
> use Win32;
> use Win32::
All,
Has anyone used the Win32::Process::Info package? I'm trying to determine
which processes are running on a machine. I can get all of the PIDS, but Im
having difficulty getting the PID info:
use Win32;
use Win32::Process;
use Win32::Process::Info;
$pi = Win32::Process::Info->new (
For there to be a deficiency with this particular aspect of Win32::Process::Create,
there would also need to be a deficiency with the underlying CreateProcess() Win32
API. The actual cause here is the omission of "notepad" in the $appname argument.
Win32::Process::Create($obj,$appnam
Hello,
I've checked the mailing list archive on active state and I can
find no reference of my issue ever being mentioned. If it has, I
apologize in advance for covering old ground.
Anyway, I just found what IMHO is a deficiency with
Win32::Process::Create. The 3 parameter (argu
e just a little bit?
-Mike Jackson
On Fri, 27 Feb 2004 11:00:24 -0600, Dirk Bremer (NISC) <[EMAIL PROTECTED]> wrote:
I have used Win32::Process in several scripts. what I can't figure out about
using it is how to create a minimized window. Looking at the constants used
with Win32:Proce
I have used Win32::Process in several scripts. what I can't figure out about
using it is how to create a minimized window. Looking at the constants used
with Win32:Process, I don't have a clue as to what some of them mean:
CREATE_DEFAULT_ERROR_MODE
CREATE_NEW_CONSOLE
CREATE_NEW_PRO
Hi all,
suppose i create a process with Win32::Process. how do i get a hold of the
processes STDIN,STDOUT, so i can write and print to/from process in the
script?
I have given "1" for the 4 param to inher
TECTED]>
To: Matthew Durante <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: Output redirection fails!, Win32::Daemon -> Win32::Process
Date: Wed, 19 Nov 2003 20:38:01 -0800
Make that perlfunc man page on prior email.
--
,-/- __ _ _ $Bill LuebkertMailto:[EMAIL P
Make that perlfunc man page on prior email.
--
,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED]
(_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED]
/ ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_http://dbecol
Matthew Durante wrote:
> Interesting, this gives different results:
>
> stat( STDOUT );
> $val = -t _;
> print "Filehandle is opened to a tty: $val\n";
> $val = -t STDOUT;
> print "Filehandle is opened to a tty: $val\n";
>
> Output:
> Filehandle is opened to a tty:
> Filehandle is opened to a tt
and exits. But this
wont tell me when the DBFTP.pl completes the FTP of all the files. For me
this is necessary because after
the successfull completion of the FTP of the files, I will have to start a
another process (Uncompress and
Restore process).
The documentation for Win32::Process is pretty
) {
while(my $connection = $listen_socket->accept)
{
SpawnConnection($connection);
$connection->close;
}
}
sub SpawnConnection {
my $socket = shift;
Win32::Process::Create($ProcessObj,
"c:\\perl\\bin\\perl.exe
: Proposal - Win32::ProcInfo becomes Win32::Process::Info
All,
I have been working (in a pretty desultory manner these days) on a module
to return information on a Windows process given its Process ID, or on all
processes in the system. So far it has been called Win32::ProcInfo. I'm
trying t
Title: Message
I don't know if this
is the correct group for this, as I rarely post anything, if not, I'm sure
someone will be kind enough to mention it.
Issue
1
I have a situation
where two processes have to be created from the same script. I'm using
Win32::Process::Cr
From: "Thomas R Wyant_III" <[EMAIL PROTECTED]>
> Periodically there's traffic on this list about how to get information
> about another NT process. I have needed some things along this line,
> including things I can't figure out how to get from Win32::PerfLib
> (the full pathname of the executable
All,
Periodically there's traffic on this list about how to get information
about another NT process. I have needed some things along this line,
including things I can't figure out how to get from Win32::PerfLib (the
full pathname of the executable is what I was really interested in).
So I have
Carl Jolley wrote:
>
> And what effect did calling the close method on the objects have?
> I assume that based on your lack of a confirming statement that
> doing so did not clear up the problem. Did your testing show why
> or based on your testing can you speculate as to why closing the
> under
On Fri, 15 Feb 2002, Trace, Robert wrote:
> > Should not each iteration of the while loop (in which $stderr
> > and $stdin are defined as my variables) result in perl closing
> > the file and releasing the file descriptor?
>
> Yes, it should (and it appears as though Perl is correctly destroying
On Fri, 15 Feb 2002, $Bill Luebkert wrote:
> Carl Jolley wrote:
>
> > On Wed, 13 Feb 2002, $Bill Luebkert wrote:
> >
> >>Sounds like you're running out of file descriptors (usually 64 or 256
> >>are available without extending). My guess is that Perl is not
> >>closing/re-using the descriptors w
Ok, I give up.
Here's a little script that attempts to spawn child processes (using
Win32::Process) and capture the output from them.
### cut here ###
#perl -w
use Win32::Process;
use IO::File;
my $loopcount = 0;
while( 1 ) {
## Save existing
open SAVEOUT, ">&STDOUT&q
I have a script which runs several programs depending upon the contents of a
state table ( implemented as a hash).
The main script and the spawned processes write into the state table and also
read from it before they perform something.
Is it necessary to implement the state table as a Shared M
From: Matthew Daly
I hope that portability questions aren't too frowned upon here. I tried
asking my Perl Unix guru friends, but I got the feeling that I would have
to redesign my program to fit the paradigm that his solution would require.
I'm using Win32::Process to create, query,
Hi folks!
I need your help! I want write one Perl script that run one other process!
Ok! I made that! But it's a problem! The process takes some minutes to
complete, and I run the script in CGI environment. I want while the
process is running to put one message on the screen, which warning the
us
Hi,
> With Win32::Process::Create...(and CREATE_NEW_CONSOLE flag)
>
> this works => u:\\mydir\\test.exe
> but this does not => myserver\\mydir\test.exe
>
Best to add error catching code to the 'Win32::Process::Create'
call. Something like :
or die ErrorRepo
- Original Message -
From: "Saxena, Saurabh" <[EMAIL PROTECTED]>
To: "'Sisyphus'" <[EMAIL PROTECTED]>; "Satish Vadlamani"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, June 20, 2001 11:29 PM
Subject: RE: Questi
Hi
Is it possible to use the Win32::Process ::Create function without giving
the full path of the exe("C:\\perl\\bin\\Perl5.6.0.exe") like
Win32::Process::Create($run_primary, 'C:\\perl\\bin\\Perl5.6.0.exe',
"perl run_primary_aa.pl", 0,CREATE_NEW_CONSOLE, ".
- Original Message -
From: "Satish Vadlamani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 4:46 PM
Subject: Question about how Win32::Process works
> Hi:
>
> 1) I want to know how Win32:Process works.
>
> 2)I am able to do
Hi:
1) I want to know how Win32:Process works.
2)I am able to do what I want to do with the following program. But I have
the perl icon is sitting on my the task bar. I check the task manager and I
see two copies of cmd.exe and two copies of Perl5.6.0.exe running. That is,
I am depending
hi all
I was wondering if some of you are able to anwser a couple of questions
regarding the win32::process module.
I am creating a ftp-client, I think i will have one script for issueing ftp
commands and the other script for handling tasks, such as multiple
connection download etc without
hi all
I was wondering if some of you are able to anwser a couple of questions
regarding the win32::process module.
I am creating a ftp-client, I think i will have one script for issueing ftp
commands and the other script for handling tasks, such as multiple
connection download etc without
> Unfortunately, this app doesn't use automated OLE. And it acts on the input
> file, so I can't just paste the input file to the clipboard.
http://search.cpan.org/doc/GSAR/libwin32-0.16/Clipboard/Clipboard.pm
might be able to.
___
Perl-Win32-Users m
76 matches
Mail list logo