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



on 4/29/04 10:16 AM, Larry Roberts at email@hidden wrote:

> From: email@hidden
> Subject: Cross filesystem resource forks
> Date: April 22, 2004 2:05:28 PM PDT
> To: email@hidden
>
> Hi,
>
> My apologies if i am posting to the wrong list, if there is a more
> appropriate one please let me know.
>
>
> Problem:
> i need to transfer files using a java client from a os x machine, to
> a linux server, and download via web browser back to the mac, retaining
> the mac specific file information.
>
> Conditions:
> - java transfer from mac os x to linux
> - i cannot use the MacBinary format because there are file operations
> that need to be performed on the server
> - web browser download from linux to mac os x OR os 9
> - i can not do anything to the files once the browser download is
> started - the file(s) are tar.gz'ed before download
> - after the download is finished, and the tar.gz is unpacked, the mac
> user must be able to double click the file and have it open with the
> appropriate app without any other operation having to be performed.
>
> My understanding of the situation:
> - the mac specific information is held in the resource fork of the file
> - the resource fork information can only be handled by the HFS/HFS+
> file system
> - when osx transfers a file between hfs and non hfs systems it creates
> a file
> called ._myfile which represents the resource fork info.
> - you need to keep this ._myfile together with the data fork myfile
> - when you transfer this pair of files back to an hfs file system, the
> mac os should use the ._myfile for the resource information.

From your conditions (especially your "limitation" of not being able to use
MacBinary) what you are asking for *is* impossible.

However, MacBinary is a relatively simple format, so I would permit the file
to be uploaded to the server in MacBinary format and any manipulations of
the data of the file (beyond just moving it around) can use a relatively
simple "stripper" that simply pulls out the data from the data fork part of
the MacBinaried file and do the manipulation on that.

I recently had to do a similar process (upload a Macintosh file to a
server), and converting the file to MacBinary did require some JNI work
(basically using JNIDirect) but if you know the format (I've done
bi-directional implementations in both C++ and Java), it is really easy to
support.

Oh, and from my reading of the AppleDouble format (which is where the
"._"-prefixed file comes from), the file system information *is* kept in
that file, but simply transferring it back to the Mac and writing it to an
HFS+ disk won't "magically" convert the file back into a valid Mac file with
the meta information intact. The Finder does that "magic" when copying
to/from non-HFS disks.

--
Glenn L. Austin <><
Computer Wizard and Race Car Driver
<email@hidden>
<http://www.austin-home.com/glenn/>
_______________________________________________
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.