in reply to Changing process name

You haven't identified which OS your running on and the answer will be different on each platform.

If you're on Win32, then this recent thread may help. If not, you'll probably get good answers from others once you identify the platform.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Changing process name
by Outaspace (Scribe) on Aug 26, 2006 at 11:05 UTC
    The changing of process names should work under Linux and/or 
    Win32, cause these are my target OS. I thought that it may not
    be possible to do such a change, but I was just curious. 
    Futhermore I use wxPerl (wxWidgets) to start subprocesses, so 
    I can't use exec or system.
    
      I use wxPerl (wxWidgets) to start subprocesses, so I can't use exec or system.

      Then how do you "start subprocesses"?

      The probablility is that under Win32, you could system 1, 'perl.exe script.pl'; as this does an asynchronous spawn. Ie. It returns immediately and so does not upset GUI message loops.

      Similarly, you could probably use system 'perl script &'; under Linux to achieve the same end.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Looks like this:
        my $szPerlExe = $this->{$this->{choPerlExecutable}->GetStringSelection +()}; my $szShell = $this->{stcShell}->GetText(); $szShell =~ s/"/\\"/g; my $szCommand = $szPerlExe.' -e '.'"'.$szShell.'"'; $this->{wProcessId} = Wx::NewId(); $this->{hProcess} = Wx::Process->new($this, $this->{wProcessId}); $this->{hProcess}->Redirect(); $this->{hProcess}->CloseOutput(); my $wProcessPid = Wx::ExecuteCommand($szCommand, wxEXEC_ASYNC|wxEXEC_N +OHIDE, $this->{hProcess}); $this->{wProcessPID}->{$wProcessPid} = $szTimeStamp; $this->{tmrProcessRunning} = Wx::Timer->new($this, $this->{wProcessId} +); $this->{tmrProcessRunning}->Start(500); EVT_TIMER($this, $this->{wProcessId}, \&ProcessRunning_OnTimer); EVT_END_PROCESS($this, $this->{wProcessId}, \&ProcessEnded);
        So I need a way to change the name of a process from within the executed script. I also use this kind of execution for system commands and scripts (without perl -e)