Re: Carbon vs Cocoa arguments
Re: Carbon vs Cocoa arguments
- Subject: Re: Carbon vs Cocoa arguments
- From: email@hidden
- Date: Tue, 15 Oct 2002 02:52:49 +0000
I wish to add that Carbon has some useful APIs which sadly are
not available for Cocoa. The File Manager and the Alias
Manager come to mind. There are some others, somebody
already mentioned the keychain APIs (although I thought
Keychain was being merged into CDSA or something).
The File Manager has functions for performing searches within
folders and such which are faster than the Cocoa counterparts.
This is probably due to using HFS+ b-trees or the fact that full
path names aren't used so less memory has to be moved
around. I'm not quite clear why, perhaps somebody could
clarify. The File Manager also has FSRefs which have no
equivalent in the UNIX world (and wouldn't fix the UNIX
methodology of everything-is-a-file-at-a-statc-path). FSRefs
allow the programmer to assume a file's path is variable, not
constant. The assumption is reversed if you use POSIX file
paths as file primitives. There is a common myth that FSRefs
are equivalent to FileIDs or file descriptors which is false.
FSRefs in OS X work with non-HFS+ volumes so they don't
behave like FileIDs, and file descriptors both require the file to
be open and you can't convert a file desciptor to a path. Core
Foundation has an FSRef object which can be converted to a
CFURL, but it's missing from Foundation proper and the open
source Core Foundation.
Alias Manager complements the File Manager in that you can't
store an FSRef (or for that matter a FileID anymore) or share
one with another process, but you can store an Alias. An Alias
is an arbitrary description of how to find a file. This is very
abstract and thus its behavior is limited by whatever filesystem
it describes. For example on UFS volumes Aliases behave like
symlinks. You can also make Aliases on HFS+ volumes which
break like symlinks by deleting the FileID and host FolderID.
Anyway what Apple ought to do here is create a plugin API so
more Alias formats can be created for new filesystems. They
also ought to provide a friggin Cocoa API. Hell, they should
deprecate the gawd-awful filesystem APIs in Cocoa and write
something new.
Lastly I want to add that I still can't develop Cocoa apps which
follow some Mac HI conventions which results in a
schizophrenic interface. I have a feeling I'll have to rewrite
NSTextView or NSLayoutManager which I still haven't figured
out how to do. Maybe somebody could help me out |-\
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.