;ò ÝTpEc@stdZdkZdkZdkZy?dkZyeiidƒZWneiidƒZnXWn eZnXde fd„ƒYZ dZ eo e edƒo¾ei iedƒZd „Zd „Zyeid ZWn d ZnXyeid ZWn dZnXed„Zd„Zd„Zd„Zd„Zd„ZdZd„Zd„ZnFeo e edƒoãe edƒo1ei ei_eiƒZ ei i!e ƒZn<e edƒoei ie"dƒZnei ei#ƒZd „Zd „Zed„Zd„Zd„Zd„Zd„Zd„Zd Zd!„Zd"„ZnLed#„Zd$„Zd%„Zd&„Zd'„Zd(„Zd)„Zd"„Ze$d*jo½e%ei&ƒd+joei&d+Z'nd,Z'e'Gee'ƒGHe'Gee'ƒGHe'Gee'dƒGHe'Gee'ƒGHee'd-d.ƒe'Gee'ƒGHe'Gee'd-ƒGHee'd-ƒe'Gee'ƒGHndS(/sê Extended attribute support. Two versions of the extended attribute API are recognized. If the 'getxattr' function is detected then the functions used are getxattr/setxattr/listxattr/removexattr. This is the API found on Linux and some others. If the 'attropen' function is found then the functions used are attropen and unlinkat. This is the API found on Solaris. If neither version is detected then a set of dummy functions are generated which have no affect. You should check the return value of the function supported(). Without an argument this returns whether extended attribute support is available. This module requires the ctypes module. This is part of Python 2.5 and available as an extension for earlier versions of Python. Nsslibc.sosNoXAttrcBstZdZd„ZRS(sJException thrown when xattr support is requested but is not available.cCsti|tid|ƒdS(NsNo xattr support(sOSErrors__init__sselfserrnos EOPNOTSUPspath(sselfspath((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys__init__&s(s__name__s __module__s__doc__s__init__(((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysNoXAttr#s suser.mime_typesattropenserrnocCs tiSdS(N(s libc_errnosvalue(((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys _get_errno/scCs6|djo%ttƒtitƒƒ|ƒ‚ndS(Ni(sressOSErrors _get_errnosossstrerrorspath(sresspath((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys _error_check1s sPC_XATTR_ENABLEDidsPC_XATTR_EXISTSiecCs$| otSnti|tƒSdS(s$Detect whether extended attribute support is available. path - path to file to check for extended attribute support. Availablity can vary from one file system to another. If path is None then return True if the system in general supports extended attributes.N(spathsTruesosspathconfs_PC_XATTR_ENABLED(spath((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys supported?scCsti|tƒdjSdS(s;Return True if extended attributes exist on the named file.iN(sosspathconfspaths_PC_XATTR_EXISTS(spath((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pyspresentMscCsßti|tiƒ ottid|ƒ‚nti|tƒdjodSnt i ||ti dƒ}|djodSnd}x@to8ti|dƒ}t|ƒdjoPn||7}qŠWt i|ƒ|SdS(sGet an extended attribute on a specified file. path - path name of file to check attr - name of attribute to get None is returned if the named attribute does not exist. OSError is raised if path does not exist or is not readable.sNo such file or directoryiNsii(sossaccessspathsF_OKsOSErrorserrnosENOENTspathconfs_PC_XATTR_EXISTSslibcsattropensattrsO_RDONLYsfdsvsTruesreadsbufslensclose(spathsattrsbufsfdsv((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysgetRs"  cCsËti|tiƒ ottid|ƒ‚nti|tƒdjogSnt i |dti dƒ}|djogSnti ƒ}ti|ƒtidƒ}ti|ƒt i|ƒ|SdS(s´Return a list of extended attributes set on the named file. path - path name of file to check OSError is raised if path does not exist or is not readable.sNo such file or directoryis.N(sossaccessspathsF_OKsOSErrorserrnosENOENTspathconfs_PC_XATTR_EXISTSslibcsattropensO_RDONLYsfdsgetcwdsodirsfchdirslistdirsattrsschdirsclose(spathsodirsfdsattrs((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pyslistxps     cCs_ti||titiBdƒ}t||ƒti ||ƒ}ti |ƒt||ƒdS(sñSet an extended attribute on a specified file. path - path name of file to check attr - name of attribute to set value - value of attribute to set OSError is raised if path does not exist or is not writable.i¤N( slibcsattropenspathsattrsossO_WRONLYsO_CREATsfds _error_checkswritesvaluesressclose(spathsattrsvaluesressfd((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pyssetˆs "  cCs[ti|dtidƒ}t||ƒti||dƒ}ti |ƒt||ƒdS(s¸Delete an extended attribute from a specified file. path - path name of file to check attr - name of attribute to delete OSError is raised if an error occurs.s.iN( slibcsattropenspathsossO_RDONLYsfds _error_checksunlinkatsattrsressclose(spathsattrsressfd((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysdelete˜s   s/cCst|jSdS(ssCheck that name is a valid name for an extended attibute. False is returned if the name should not be used.N(sname_invalid_charssname(sname((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys name_valid¨scCstSdS(siReturns True if the value of an extended attribute may contain embedded NUL characters (ASCII 0).N(sTrue(((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysbinary_value_supported®ssgetxattrs__errno_locationcCsH| otSnti|tiƒ ottid|ƒ‚ntSdS(s$Detect whether extended attribute support is available. path - path to file to check for extended attribute support. Availablity can vary from one file system to another. If path is None then return True if the system in general supports extended attributes.sNo such file or directoryN( spathsFalsesossaccesssF_OKsOSErrorserrnosENOENTsTrue(spath((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys supportedÉs cCskti|tiƒ ottid|ƒ‚ntidƒ}t i |ti |ƒdƒ}|djSdS(s;Return True if extended attributes exist on the named file.sNo such file or directoryiiN(sossaccessspathsF_OKsOSErrorserrnosENOENTsctypessc_buffersbufslibcs listxattrsbyrefsn(spathsnsbuf((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pyspresentÚs cCsšti|tiƒ ottid|ƒ‚nti||ddƒ}|djodSnt i |dƒ}ti||t i|ƒ|ƒ|iSdS(sGet an extended attribute on a specified file. path - path name of file to check attr - name of attribute to get None is returned if the named attribute does not exist. OSError is raised if path does not exist or is not readable.sNo such file or directorysiNi(sossaccessspathsF_OKsOSErrorserrnosENOENTslibcsgetxattrsattrssizesctypessc_buffersbufsbyrefsvalue(spathsattrsbufssize((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysgetås cCs¥ti|tiƒ ottid|ƒ‚nti|t dƒ}|djogSnt i |ƒ}ti|t i|ƒ|ƒ}|id idƒ}|SdS(s´Return a list of extended attributes set on the named file. path - path name of file to check OSError is raised if path does not exist or is not readable.sNo such file or directoryiiiÿÿÿÿsN(sossaccessspathsF_OKsOSErrorserrnosENOENTslibcs listxattrsNonessizesctypesscreate_string_buffersbufsbyrefsnsrawssplitsnames(spathsbufsnsnamesssize((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pyslistxùs cCsbti|tiƒ ottid|ƒ‚nti|||t |ƒdƒ}t ||ƒdS(sñSet an extended attribute on a specified file. path - path name of file to check attr - name of attribute to set value - value of attribute to set OSError is raised if path does not exist or is not writable.sNo such file or directoryiN(sossaccessspathsF_OKsOSErrorserrnosENOENTslibcssetxattrsattrsvalueslensress _error_check(spathsattrsvaluesres((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysset s !cCsSti|tiƒ ottid|ƒ‚nti||ƒ}t ||ƒdS(s¸Delete an extended attribute from a specified file. path - path name of file to check attr - name of attribute to delete OSError is raised if an error occurs.sNo such file or directoryN( sossaccessspathsF_OKsOSErrorserrnosENOENTslibcs removexattrsattrsress _error_check(spathsattrsres((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysdeletes scCs'|idƒ otSnt|jSdS(ssCheck that name is a valid name for an extended attibute. False is returned if the name should not be used.suser.N(snames startswithsFalsesname_invalid_chars(sname((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys name_valid*scCstSdS(siReturns True if the value of an extended attribute may contain embedded NUL characters (ASCII 0).N(sFalse(((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysbinary_value_supported2scCstSdS(s$Detect whether extended attribute support is available. path - path to file to check for extended attribute support. Availablity can vary from one file system to another. If path is None then return True if the system in general supports extended attributes.N(sFalse(spath((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys supported;scCstSdS(s;Return True if extended attributes exist on the named file.N(sFalse(spath((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pyspresentFscCs8ti|tiƒ ottid|ƒ‚ndSdS(sGet an extended attribute on a specified file. path - path name of file to check attr - name of attribute to get None is returned if the named attribute does not exist. OSError is raised if path does not exist or is not readable.sNo such file or directoryN(sossaccessspathsF_OKsOSErrorserrnosENOENT(spathsattr((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysgetKscCs8ti|tiƒ ottid|ƒ‚ngSdS(s´Return a list of extended attributes set on the named file. path - path name of file to check OSError is raised if path does not exist or is not readable.sNo such file or directoryN(sossaccessspathsF_OKsOSErrorserrnosENOENT(spath((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pyslistxYscCst|ƒ‚dS(sñSet an extended attribute on a specified file. path - path name of file to check attr - name of attribute to set value - value of attribute to set OSError is raised if path does not exist or is not writable.N(sNoXAttrspath(spathsattrsvalue((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pyssetdscCst|ƒ‚dS(s¸Delete an extended attribute from a specified file. path - path name of file to check attr - name of attribute to delete OSError is raised if an error occurs.N(sNoXAttrspath(spathsattr((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pysdeleteoscCstSdS(ssCheck that name is a valid name for an extended attibute. False is returned if the name should not be used.N(sFalse(sname((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys name_validyss__main__is/tmps user.teststhis is a test((s__doc__sosssysserrnosctypesscdlls LoadLibraryslibcsNonesOSErrorsNoXAttrsUSER_MIME_TYPEshasattrsc_intsin_dlls libc_errnos _get_errnos _error_checkspathconf_namess_PC_XATTR_ENABLEDs_PC_XATTR_EXISTSs supportedspresentsgetslistxssetsdeletesname_invalid_charss name_validsbinary_value_supporteds__errno_locationsrestypes errno_locs from_addressslibs EOPNOTSUPs__name__slensargvspath(ssets _get_errnos name_valids supporteds_PC_XATTR_ENABLEDs errno_locsbinary_value_supportedsUSER_MIME_TYPEserrnos_PC_XATTR_EXISTSslistxsgetslibcs _error_checkssyssctypessname_invalid_charss libc_errnospresentsNoXAttrspathsossdelete((sS/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/xattr.pys?s