• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to tell if file wrapper represents package
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to tell if file wrapper represents package


  • Subject: Re: How to tell if file wrapper represents package
  • From: Mike Abdullah <email@hidden>
  • Date: Sun, 14 Jul 2013 20:39:08 +0100

On 14 Jul 2013, at 17:59, Kyle Sluder <email@hidden> wrote:

> On Jul 14, 2013, at 9:33 AM, Mike Abdullah <email@hidden> wrote:
>
>>
>> On 14 Jul 2013, at 08:40, Shane Stanley <email@hidden> wrote:
>>
>>> On 14/07/2013, at 1:30 PM, Lee Ann Rucker <email@hidden> wrote:
>>>
>>>> Haven't tried it, but [NSWorkspace isFilePackageAtPath:] looks like what you want. If that's not sufficient, there are other things in NSWorkspace that test files.
>>>
>>> The problem, though, is that a file wrapper doesn't have a path.
>>
>> I think you have a couple of options, neither terribly satisfactory:
>>
>> A) Use the .filename property to work your way through the wrappers and build up the expected URL/path of the file. Then query that to know if it's a package.
>
> This sounds like the correct approach to me. Grab the file extension, call UTTypeCreatePreferredIdentifierForTag to convert it to a UTI, then call UTTypeConformsTo (or -[NSWorkspace type:conformsToType:]) to determine if the type confirms to kUTTypePackage.

I have to admit, relying on file extension makes me uncomfortable, but maybe it's good enough.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: How to tell if file wrapper represents package
      • From: Kyle Sluder <email@hidden>
References: 
 >How to tell if file wrapper represents package (From: Shane Stanley <email@hidden>)
 >Re: How to tell if file wrapper represents package (From: Lee Ann Rucker <email@hidden>)
 >Re: How to tell if file wrapper represents package (From: Shane Stanley <email@hidden>)
 >Re: How to tell if file wrapper represents package (From: Mike Abdullah <email@hidden>)
 >Re: How to tell if file wrapper represents package (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Cocoa-dev Digest, Vol 10, Issue 427
  • Next by Date: Re: How to tell if file wrapper represents package
  • Previous by thread: Re: How to tell if file wrapper represents package
  • Next by thread: Re: How to tell if file wrapper represents package
  • Index(es):
    • Date
    • Thread