Re: Copying things
Re: Copying things
- Subject: Re: Copying things
- From: "John C. Daub" <email@hidden>
- Date: Mon, 25 Jun 2001 07:26:42 -0500
on 6/24/01 2:01 PM, Greg Titus at email@hidden wrote:
>
> world), and I'm curious what the "best" (or maybe that should be "blessed")
>
> way is to copy things: files, folders, whole volumes/disks, etc.. from one
>
> location to another (i.e. not just duplicate in place).
>
[...]
>
>
> Is there a Cocoa mechanism for doing this? or will I need to use Carbon
>
> techniques?
>
>
Yes: if you want a copy panel to show up in the Finder and show
>
progress, et cetera, look at NSWorkspace
>
-performFileOperation:source:destination:files:tag:. If you'd rather do
>
the copy yourself behind the scenes, use NSFileManager
>
-copyPath:toPath:handler:. The latter may not preserve resource forks -
>
I'm not certain. I'd certainly consider it a bug if it didn't.
Sounds like just the thing I'm looking for. The big thing is ensuring all
that "classic Mac OS" file metadata gets preserved.... I don't want anything
to get lost as the files are moved (within reason, e.g. HFS+ -> UFS I figure
something will get lost).
Thanx. I'll try this out later.
--
John C. Daub }:-)>=
<
mailto:email@hidden> <
http://www.hsoi.com/>
"Learn to be still." -- Don Henley, the Eagles.