Re: Copying things
Re: Copying things
- Subject: Re: Copying things
- From: Greg Titus <email@hidden>
- Date: Sun, 24 Jun 2001 12:01:54 -0700
On Sunday, June 24, 2001, at 11:46 AM, John C. Daub wrote:
>
Hello.
>
>
I'm fiddling around with Objective C and Cocoa (I come from the
>
C++/Carbon
>
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.
Hope this helps,
--Greg