Content-Type: |
text/plain; charset=UTF-8 |
Date: |
Thu, 8 May 2008 13:02:24 -0400 |
Content-Disposition: |
inline |
Reply-To: |
|
Subject: |
|
MIME-Version: |
1.0 |
Content-Transfer-Encoding: |
7bit |
Sender: |
|
From: |
|
Parts/Attachments: |
|
|
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]>
|
|
|