r/w resource forks

  • Hey folks

    IIUC there is no official API to read and write resource forks from
    Cocoa.
    Anyone know of a framework somewhere? Couldn't find anything through
    Google yet.

    cheers
    --
    Torsten
  • Le 15 févr. 08 à 20:43, Torsten Curdt a écrit :

    > Hey folks
    >
    > IIUC there is no official API to read and write resource forks from
    > Cocoa.
    > Anyone know of a framework somewhere? Couldn't find anything through
    > Google yet.
    >
    > cheers
    > --
    > Torsten
    >

    The official API to read and write resources forks from Cocoa is the
    CoreServices's File Manager.
    OK, this is not an obj-c API, but isn't obj-c just a C superset?

    If you prefere an Obj-C class, there is NSResourceFork (http://homepage.mac.com/nathan_day/pages/source.xml#ndresourcefork
    )
  • On 2/15/08 8:43 PM, Torsten Curdt said:

    > IIUC there is no official API to read and write resource forks from
    > Cocoa.

    Yes there is, the Resource Manager.  But it is a C API, not and
    Objective-C API.

    > Anyone know of a framework somewhere? Couldn't find anything through
    > Google yet.

    Obj-C wrapper:
    <http://homepage.mac.com/nathan_day/pages/source.xml#ndresourcefork>

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
  • >> Anyone know of a framework somewhere? Couldn't find anything through
    >> Google yet.
    >
    > Obj-C wrapper:
    > <http://homepage.mac.com/nathan_day/pages/source.xml#ndresourcefork>

    Cool ...that wrapper looks like what I was after!!

    cheers
    --
    Torsten
  • Instead of using resource forks I thought I could use a bundle. So I
    have created a test.pdf folder and set the bundle bit. The original
    pdf is included in the Resources section. If I could now instruct
    other apps to open that original pdf inside the bundle on a double-
    click/open ...that would be perfect. I would hope hand crafting a
    proper Info.plist could do that. But I haven't found the right key/
    documentation yet. Anyone know whether that is possible at all?

    But anyway ...this is in no way related to Cocoa APIs - so I am sorry
    for the OT post. (offlist answers are welcome of course :))

    So this post is more: any suggestion where to ask such a question
    instead?

    cheers
    --
    Torsten
  • Le 17 févr. 08 à 14:08, Torsten Curdt a écrit :

    > Instead of using resource forks I thought I could use a bundle. So I
    > have created a test.pdf folder and set the bundle bit. The original
    > pdf is included in the Resources section. If I could now instruct
    > other apps to open that original pdf inside the bundle on a double-
    > click/open ...that would be perfect. I would hope hand crafting a
    > proper Info.plist could do that. But I haven't found the right key/
    > documentation yet. Anyone know whether that is possible at all?
    >
    > But anyway ...this is in no way related to Cocoa APIs - so I am
    > sorry for the OT post. (offlist answers are welcome of course :))
    >
    > So this post is more: any suggestion where to ask such a question
    > instead?
    >
    > cheers
    > --
    > Torsten

    You should not use a well known extension for your own format. OS X,
    and the Launch service use the extension to define the document type
    and properties. Using pdf on a bundle will confuse the system and
    other applications.