[issue12978] Figure out extended attributes on BSDs

Nicholas Riley report at bugs.python.org
Mon Mar 12 23:51:06 CET 2012


Nicholas Riley <com-python-bugs at sabi.net> added the comment:

I've spent a few hours looking at xattr and the Linux/OS X (10.4+) implementations.  Bob Ippolito's xattr module implements the OS X xattr interface on Linux, Solaris (9+) and FreeBSD.  Linux and OS X are pretty close; FreeBSD and Solaris are substantially different from either and the Solaris implementation is somewhat incomplete/broken.

The OS X differences from Linux are:

• Instead of l* functions, the XATTR_NOFOLLOW option

• XATTR_NOSECURITY and XATTR_NODEFAULT are in the headers but essentially unavailable as the kernel code always returns EINVAL for them.

• XATTR_SHOWCOMPRESSION to expose the HFS compression stuff, which I can't imagine many people needing

• XATTR_MAXNAMELEN (but no equivalent to XATTR_SIZE_MAX).  Linux has a corresponding XATTR_NAME_MAX, which we should probably expose too.

• XATTR_FINDERINFO_NAME and XATTR_RESOURCEFORK_NAME for some standard attribute names.  I would imagine these are worth exposing.

I don't see any problems supporting the currently exposed Linux API on OS X  (I could probably find a usable value for XATTR_SIZE_MAX), but it's unclear if that is the right way to go forward.

Suggestions?

----------
nosy: +nriley

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12978>
_______________________________________


More information about the Python-bugs-list mailing list