Packages

Mark Smith mark at maseurope.net
Sun Dec 9 00:32:32 EST 2007


Sadly, the presence of /contents/pkginfo or info.plist is not  
guaranteed. The .rtfd package/files that TextEdit produces on this  
machine don't have them, but the finder still treats the .rtfd files  
as packages.

Best,

Mark

On 9 Dec 2007, at 05:23, J. Landman Gay wrote:

> Chipp Walters wrote:
>> Good one Sarah, now how to create an
>> isBundle() function without the answer file command?
>
> Are you trying to identify any kind of bundle or just a specific type?
>
> You can read the first four characters of the /Contents/Pkginfo  
> file to get the specific type; apps are APPL, bundles are BNDL,  
> etc. Just the existence of a /Contents/Pkginfo file itself is  
> fairly persuasive for identifying a generic bundle or package, and  
> if the contents of the file are exactly 8 characters you can be  
> pretty sure you've got yourself a bundle.
>
> Off the top of my head, for generic bundles:
>
> function isBundle pPath
>   put "/Contents/PkgInfo" after pPath
>   return len(url ("file:"&pPath)) = 8
> end isBundle
>
> Or for specific ones, like .band files:
>
> function isBundle pPath
>   put "/Contents/PkgInfo" after pPath
>   return char 1 to 4 of url ("file:"&pPath) = "BNDL"
> end isBundle
>
>
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list