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

Re: [MacPerl] Using the Resource Mangler from MacPerl



At 18:28 -0500 3/28/97, Paul J. Schinder wrote:
>Which brings up a question I've been hunting for an answer for for about a
>week.  Eryq has released an alpha of Convert::BinHex, and I'd like to turn
>it into a real de-Binhexer for MacPerl.  I know what to do with the data
>fork, but what do I do with the resource fork?  Is there a tricky way to
>lay down the decoded resource fork, or do you actually have to parse it and
>write the resources into a file?  I've been looking around for information
>on MacBinary, but the stuff I found on Apple's sites did not look like it
>had the answer, or at least the answer I was hoping to find.  (What with a
>scriptable Stuffit Expander and all there's no pressing reason to do this,
>but it seems kind of stupid not to.)

You want a suitable one of the series of toolbox routines which opens the
resource fork as just plain data, accessed with the regular reading and
writing calls.  The top of the pyramid is (speaking toolbox, not Perl
toolbox which I haven't had time to look at)
  FSpOpenRF

[You need to create the resource fork first, if building a file from
scratch, or adding a resource fork to a file without one].  FSpCreate will
have done that, if that's what you use.]

   --John

--
John Baxter (Born before ENIAC, but not by much.)
   jwblist@olympus.net      Port Ludlow, WA, USA