[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Process lister (was Unix daemons in Perl on MacOS?)



Brian McNett wrote:
>Meanwhile, on the topic of writing a 'polite' process, I dug up this
>little gem from Chris Nandor's Apple Event Tutorial:
>
>#!perl -w
>
>use Mac::Processes;
>
>foreach my $psi (values %Process) {
>	printf("%s %s\n",
>	$psi->processSignature(),
>	$psi->processName()
>    );
>}
>


Interesting.

Try the following slightly modified example from the 'Mac::Processes'
module. It would be more interesting if I took the time to decipher the
modes, date, time, location, etc.  Access to the 'processSize' (ram used)
and 'processAppSpec' (file path) info will be quite useful to me. Thanks
for pointing this out.


#!perl

use Mac::Processes;

foreach my $psi (values %Process) {
    print "PROCESS Name = ", $psi->processName,
    "\n      Number = ", $psi->processNumber,
    "\n        Type = ", $psi->processType,
    "\n   Signature = ", $psi->processSignature,
    "\n        Size = ", $psi->processSize,
    "\n        Mode = ", $psi->processMode,
    "\n    Location = ", $psi->processLocation,
    "\n    Launcher = ", $psi->processLauncher,
    "\n  LaunchDate = ", $psi->processLaunchDate,
    "\n  ActiveTime = ", $psi->processActiveTime,
    "\n     AppSpec = ", $psi->processAppSpec, "\n\n";
}

__END__



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org