Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java file transfer from hfs to non-hfs filesystem and back



Larry Roberts wrote:
| My understanding of the situation:
| - the mac specific information is held in the resource fork of the file

This is a remarkably common misbelief. The Mac metadata is not kept in the resource fork, it's kept in the file system catalog, just like the other file metadata (creation time, owner, etc.) The only metadata that's in the resource fork that I can think of is the file's custom icon. In any case, if the file *has* a resource fork, for whatever reason, the contents of the resource fork must be preserved. (Note that the flag that indicates that a file *has* a custom icon is *not* kept in the file's resource fork, but is part of the metadata kept in the file system catalog.)


| - the resource fork information can only be handled by the HFS/HFS+
| file system

That depends on what you mean by "handled". A file with a resource fork can be kept--and used--on a UFS volume. Any resource-fork-aware program will remain blissfully ignorant of the OS's sleight-of-hand with the resource fork. The main difference is that the forks aren't inextricably bound together on a UFS volume as they are on an HFS volume.


| - when osx transfers a file between hfs and non hfs systems it creates
| a file
| called ._myfile which represents the resource fork info.

It doesn't "represent" the resource fork, it *is* the resource fork. As noted above, the OS takes the necessary steps to allow a resource-fork-aware program to use it without any changes.


| - you need to keep this ._myfile together with the data fork myfile

You also need to keep the file metadata.


| - when you transfer this pair of files back to an hfs file system, the
| mac os should use the ._myfile for the resource information.

But the metadata has to be set separately. (I don't know offhand how that metadata is stored on a UFS file system, but I believe that Apple does indeed have someplace to store it.)


| My current implementation:
| - i have the SplitForks utility from the /Developer/Tools package
| - the java app uses the SplitForks tool (SplitForks myfile) before the
| transfer
| - both files are transferred to the linux server
| - files are tarred and gzipped before download
| - files can be downloaded and unpacked
| - md5 on the downloaded ._myfile and myfile show that they are
| identical
| - mac os does not find any creator/type information

Because, as noted, it's not kept in the resource fork, but in the file system catalog, along with a wad of other Mac-specific attributes which *also* need to be preserved (notably, the "Finder flags").

Glen Fisher
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >java file transfer from hfs to non-hfs filesystem and back (From: Larry Roberts <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.