Create AppleDouble File in Linux
I am working on an application that syncs data. For Mac OS the files are loaded and if they contain resource resource information then fork is read and saved as a string using: file / .. namedfork / rsrc
Users can access their files using a web application (Java) that runs on a Linux server, is there a way that I can create a valid AppleDouble format file using just the data fork and string I read from namedfork? I don't mind losing Finder metadata.
Note. The generated file will be downloaded (using the web application) as a separate file for Mac OS users.
Is it possible?
Hello
the wikipedia article reads:
AppleSingle merged the fork file and associated Finder metadata information into one file, while AppleDouble saved them as two separate files.
Apple's knowledge base article reads:
The second new file has the name of the original file prefixed with "._" and contains the fork resource of the original file.
So my guess is that you just need to save the contents of your resource fork line to a file with the appropriate name.
Edit: Following your comment, I'm not sure what you want. Your question was how
Create file with AppleDouble formatting in Linux
and the related documentation shows that you need to create two files for this containing data and one containing a resource fork with a name that has a ._ prefix. If this is not what you want, then you need to ask another question.
source to share
As far as I know, OS 9 / OS X can only natively access resource forks in files served by AppleTalk promotions. For other environments, eg. SMB (Microsoft Networking) or HTTP, the only way to preserve the resource is to archive the file.
There are several Mac supported archive formats, such as StuffIt and HQX . I highly doubt the Linux binaries for StuffIt allow you to package a fork of resources from a separate file, but at least you can appreciate something.
Looking at the AppleDouble entry on Wikipedia, it seems possible to create such a file from a non-Apple machine using an open source tool and submit the resulting file using the multipart/appledouble
MIME type . Perhaps you could name this binary from your Java code?
source to share