On 10/9/01 10:39 AM, Randal L. Schwartz wrote:
> It's too bad "ppt" didn't get to rsync. :)

Well, that was next on my alphabetical list after "robots"... ;)

> From what I understand, this should copy a file $foo to $bar
> completely:
> 
>       use File::Copy;
>       copy($foo, $bar);
>       copy("$foo/rsrc", "$bar/rsrc");

You're still missing the "Finder flags" (e.g. the locked bit, custom icon
bit, bundle bit), the type/creator codes, and any other HFS/HFS+ metadata
(which is not stored in the resource fork).

If you use the OS X APIs for "lossless" file copy, you get it all.  Try
copying a "Mac file" from an HFS/HFS+ volume to a UFS volume in the Finder.
You'll see how it creates two files, "foo" and "._foo" on the destination
drive.  "._foo" contains both the resource fork *and* all the associated
metadata.  The Finder knows how to "reconstitute" the two files as well.
either when copying back or when reading the file on the UFS volume.

> In fact, if we could just teach File::Copy to do that on the mac... {grin}

Well, if you could write an XS module that hooks into the same APIs that the
Finder is using... :)

-John

Reply via email to