Re: Modify Data Fork
Re: Modify Data Fork
- Subject: Re: Modify Data Fork
- From: Christopher Nebel <email@hidden>
- Date: Mon, 19 Nov 2001 16:42:06 -0800
On Thursday, November 15, 2001, at 11:51 AM, Markus Schutt wrote:
Does somebody know , how to delete the first 50(e.g.)
Bytes from the Data Fork without copying the whole
file.
The short answer is it can't be done, and it's not an AppleScript
problem. (It might be possible to *say* this efficiently, but the
implementation would still have to rewrite the entire file.) You'd have
to have direct support from the file system in order to do this, and no
OS I've ever heard of does.
That said, it's possible to cheat in some cases. If the file format has
some sort of "filler" character you can put in, then you can overwrite
those 50 unwanted characters instead, or perhaps slide a little stuff
around.
For example, say you've got a mostly-normal EPSF file, but it's got 50
bytes of junk at the front before the %!PS. You could find where the
normal header comments end (they're only a few lines long, as I recall),
copy them up to the front, and then write an extra comment to fill in
the now-dead space. Presto!
--Chris Nebel
AppleScript Engineering