• 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: NSHFSTypeCodeFromFileType troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSHFSTypeCodeFromFileType troubles


  • Subject: Re: NSHFSTypeCodeFromFileType troubles
  • From: "David W. Halliday" <email@hidden>
  • Date: Thu, 07 Mar 2002 14:56:34 -0600
  • Organization: TNRCC

Chris Gervais wrote:

> Ah...I didn't even think to include the single quote as I thought that
> NSHFSTypeCodeFromFileType just took the string as it was...the doc needs to
> be more clear on this!
>
> > Well OSTypes are just a 4 characters string const, like 'JPEG'.
> >
> > An file type right now for an HFSfile type(OSType) is encode like
> > @"'JPEG'",
> > note the single quotes this is important.
> >
> > Thanks,
> > Andrew Pinski
> >
> > ...

One caveat: The present form of the encoding of HFS file types into NSStrings
is an /implementation detail/ and, hence, cannot be relied upon for all time.
Unfortunately, other than directly creating OSTypes, via 'ostp' (Apple added an
extension to gcc to allow for these special cases of the character quote---one of
the extensions that, presumably, will /never/ make it into the mainstream) there is
no function to create such OSTypes from strings (though one would be easy enough to
code, and would not have the dependency on the implementation of
NSHFSTypeCodeFromFileType, nor the Apple extension to gcc).

email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSHFSTypeCodeFromFileType troubles
      • From: "David W. Halliday" <email@hidden>
References: 
 >Re: NSHFSTypeCodeFromFileType troubles (From: Chris Gervais <email@hidden>)

  • Prev by Date: Help with IBOutlets
  • Next by Date: Re: Closing windows bearing sheets
  • Previous by thread: Re: NSHFSTypeCodeFromFileType troubles
  • Next by thread: Re: NSHFSTypeCodeFromFileType troubles
  • Index(es):
    • Date
    • Thread