Geoff Levner wrote:
>We use the Mac commands Rez and DeRez to do this: DeRez to "decompile" the
>resource fork into a normal file, Rez to combine the data and resource
>forks back into a Mac file. Both are installed with the developer tools,
>though, in the /Developer/Tools folder, so you can't count on them being on
>all users' machines.
If you're not also using GetFileInfo and SetFile, you're losing
file-creator, file-type, and Finder flags. These are critical for
alias-files, because without the right values, aliases lose their aliasness.
GetFileInfo and SetFile are also only installed with Developer Tools, so if
you can get away with DeRez/Rez, you can be fairly certain of getting away
with GetFileInfo/SetFile.
Convincing non-developers to first download and install all of Developer
Tools just to get those commands is a slightly more difficult option than
installing a JNI library.
Frankly, you could just as easily gzip or tar the data-fork and
named-resource-fork without using Rez/DeRez at all. AFAIK, there's still
no solution for preserving metadata, though.
Named resource forks work on ppc or i386, so I don't see how DeRez/Rez is
really giving you anything you can't already get another way, and without
needing Developer Tools installed. For example, the 'ls' command is
ignorant of resource forks, and so is 'md5', but this will show sizes and
hashes of any resource-forks of any file that has them:
ls -l */rsrc
md5 */rsrc
These examples use the older easier-to-type notation of "/rsrc" suffixed to
an ordinary file's pathname. That works in Java, too, as does the
..namedfork/rsrc notation (try it on a FileInputStream).
One possible option may be to script the Finder to produce a zip-archive of
the desired file. This should include all the metadata and resource fork
contents, assuming the Finder can be told to do that.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden