<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >xattr Functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="函数参考" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="win32_stop_service" HREF="function.win32-stop-service.html"><LINK REL="NEXT" TITLE="xattr_get" HREF="function.xattr-get.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.win32-stop-service.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.xattr-get.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.xattr" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >CLXXVII. xattr Functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN239314" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="xattr.intro" >简介</A ></H1 ><P > The xattr extension allows for the manipulation of extended attributes on a filesystem. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="xattr.requirements" >需求</A ></H1 ><P > To use xattr, you will need libattr installed. It is available at <A HREF="http://oss.sgi.com/projects/xfs/" TARGET="_top" >http://oss.sgi.com/projects/xfs/</A >. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > These functions only work on filesystems that support extended attributes, and have them enabled at mount time. Some common filesystems that support extended attributes are ext2, ext3, reiserfs, jfs, and xfs. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="xattr.installation" >安装</A ></H1 ><P > xattr is currently available through PECL <A HREF="http://pecl.php.net/package/xattr" TARGET="_top" >http://pecl.php.net/package/xattr</A >. </P ><P > If <A HREF="http://pear.php.net/" TARGET="_top" >PEAR</A > is available on your *nix-like system you can use the pear installer to install the xattr extension, by the following command: <B CLASS="command" >pear -v install xattr</B >. </P ><P > You can always download the tar.gz package and install xattr by hand: <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN239332" ></A ><P ><B >例 1. xattr install by hand</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="shell" >gunzip xattr-xxx.tgz tar -xvf xattr-xxx.tar cd xattr-xxx phpize ./configure && make && make install</PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="xattr.constants" >预定义常量</A ></H1 ><P >以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。</P ><P ></P ><DIV CLASS="variablelist" ><DL ><DT ><TT CLASS="constant" ><B >XATTR_ROOT</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Set attribute in root (trusted) namespace. Requires root privileges. </P ></DD ><DT ><TT CLASS="constant" ><B >XATTR_DONTFOLLOW</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Do not follow the symbolic link but operate on symbolic link itself. </P ></DD ><DT ><TT CLASS="constant" ><B >XATTR_CREATE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Function will fail if extended attribute already exists. </P ></DD ><DT ><TT CLASS="constant" ><B >XATTR_REPLACE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Function will fail if extended attribute doesn't exist. </P ></DD ></DL ></DIV ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >目录</B ></DT ><DT ><A HREF="function.xattr-get.html" >xattr_get</A > -- Get an extended attribute </DT ><DT ><A HREF="function.xattr-list.html" >xattr_list</A > -- Get a list of extended attributes </DT ><DT ><A HREF="function.xattr-remove.html" >xattr_remove</A > -- Remove an extended attribute </DT ><DT ><A HREF="function.xattr-set.html" >xattr_set</A > -- Set an extended attribute </DT ><DT ><A HREF="function.xattr-supported.html" >xattr_supported</A > -- Check if filesystem supports extended attributes </DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.win32-stop-service.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.xattr-get.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >win32_stop_service</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >xattr_get</TD ></TR ></TABLE ></DIV ></BODY ></HTML >