MACSCRPT Archives

May 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 8 May 2008 13:02:24 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (24 lines)
Thought some of you might be interested in the Perl script I used to
restore Mac metadata on 200MB of font files that were written to
MS-DOS-formatted Zip disks from OS 9.   There are no doubt third party
tools I could have downloaded or bought that would have done the job
as well; I must say that I'm surprised that OS X doesn't just know how
to handle these discs out of the box.  Seems like a glaring oversight.

My script traverses the directory structure, finds FINDER.DAT files,
reads them to find the creator/type and resource fork locations, then
uses MacPerl::SetFileInfo to restore the former and File::Copy with
the "/rsrc" pathname to restore the latter.  In the interest of
paranoia I didn't have it delete any of those no-longer-needed files;
I did that manually after some spot checks.

It's very ad-hoc; I decoded the FINDER.DAT files by inspection, just
looking for the bits that mattered to me.  The main gotcha was that
the 92-byte directory entries are grouped into 2048-byte blocks, even
though that's not a whole number of entries: just reading through the
file an entry at a time gets you out of sync after the block
transitions.

-- 
Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2