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

Re: [MacPerl-Toolbox] Determining a full path to the currentfolder



At 2:42 +0930 1999.09.12, Henry Penninkilampi wrote:
>I want to determine the full path to the folder in which a MacPerl
>application resides, and has just been launched.

$ENV{MACPERL} gives exactly that.

>use Mac::Processes;
>
>$processID = GetCurrentProcess();
>$appPath = $Process{$processID}->processAppSpec();
>$appNameLength = length $Process{$processID}->processName();
>$folderPath = substr($appPath,0,(-1 * $appNameLength));

If you were going to do this, I'd think a better way would be:

  use File::Basename;
  $folderPath = dirname($appPath);

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

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