Re: What is the best way to copy files
Re: What is the best way to copy files
- Subject: Re: What is the best way to copy files
- From: j o a r <email@hidden>
- Date: Sat, 10 Jan 2009 13:39:24 -0800
On Jan 10, 2009, at 1:23 PM, David wrote:
This is sort of a conceptual question.
The broader question is what is the purpose of Cocoa and how does it
relate to Core Foundation and Unix.
The specific question is, what is the best way to copy files.
I think that one thing is clear: It's probably not smart to try to
implement file copying by manually reading in and writing out files.
Use the API:s provided at either the unix, Carbon or Cocoa layers.
Which one to choose depends on your requirements.
You forgot one important API in your list: copyfile (for more
information, see the man page).
This also addresses a broader question I have about how Cocoa relates
to Core Foundation, to Unix APIs and even to standard C functions.
I had thought Cocoa was a wrapper for Core Foundation, but
NSFileManager is not a wrapper. There is no equivalent in Core
Foundation, while the Carbon file manager has no equivalent in Cocoa.
Cocoa sits on top of a bunch of C libraries, including standard unix
and Carbon. Cocoa is not simply some sort of wrapper around CF, and
actually pre-dates the introduction of CF. Cocoa and Carbon evolved on
separate operating systems originally, so there is no simple mapping
between the functionality that they provide. In some cases Carbon
provides a better feature set, in some cases Cocoa. You'd have to pick
the best API to use for your particular purpose, while making sure to
stay away from any deprecated API:s.
j o a r
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden