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

Re: [MacPerl] Identifying Applications



On Thu, 3 Feb 2000 23:10:14 +0800, robinmcf@altern.org wrote:

>Currently I'm using the '-B' and '-X' file tests  to find files that are
>both Binary and Exec-able, 

That is a rather silly thing on a Mac.

>but this also returns a lot of files which are
>non apps, making my next logical step to start filtering by checking the
>creator codes of the files thrown up to back track to their owner apps.
>
>Is there a Mac specific way to do the same thing through toolbox calls?

Simply check the file type. If it is "APPL", then you have an
application!

Check "Macintosh Specific Features" in Help:
"MacPerl::GetFileInfo(FILE)".

    #!perl -w
    ($\,$,) = ("\n", ' --> ');
    foreach(@ARGV) {
        print $_, scalar MacPerl::GetFileInfo($_);
    }
__END__
Save as droplet, drop an application file on it.

-- 
	Bart.

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