Le 28 avr. 08 à 11:27, Gerriet M. Denkmann a écrit :


On 28 Apr 2008, at 07:44, [EMAIL PROTECTED] wrote:


Others have answered with good suggestions for other APIs, but I will
point out for the record that you can do it in Cocoa, too, because the
file system has a path-based mechanism in which "..namedfork/rsrc" is
appended to the path.  For example, in Terminal:

$ ls -li Documents//Example.doc
108 -rw-r--r--@ 1 aburgh  aburgh  23552 Apr 27  2006 Documents/
Example.doc

$ ls  -li Documents/Example.doc/..namedfork/rsrc
108 -rw-r--r--  1 aburgh  aburgh  286 Apr 27  2006 Documents/
Example.doc/..namedfork/rsrc

Notice that the "inode" is the same (the Catalog Node ID on HFS+), but
size reflects the different forks.  You can use this technique from
any program that lets you specify a path, such as command line
utilities, and you can even read and write the contents of the forks
this way.  This is documented in the Mac OS X system documentation.

Where exactly?
I have found a mention of "namedfork" in man RezWack and some #defines in /usr/include/sys/paths.h - but no other documentation.


Kind regards,

Gerriet.


Relying on the ..namedfork "hack" is not a good idea. The way it handles other FS than HFS changed a lot between major version. It's not documented and may disapear in the futur. If you do not have any requirement (using BSD API for example) you should use the CoreServices File Manager or other "high-level" API. That the most reliable way to do what you want.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to