Forum und email

xattr Functions

소개

The xattr extension allows for the manipulation of extended attributes on a filesystem.

요구 조건

To use xattr, you will need libattr installed. It is available at » https://oss.sgi.com/projects/xfs/.

Note: 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.

설치

xattr is currently available through PECL » https://pecl.php.net/package/xattr.

If » PEAR is available on your *nix-like system you can use the pear installer to install the xattr extension, by the following command: pear -v install xattr.

You can always download the tar.gz package and install xattr by hand:

Example#1 xattr install by hand

gunzip xattr-xxx.tgz
tar -xvf xattr-xxx.tar
cd xattr-xxx
phpize
./configure && make && make install

예약 상수

이 확장은 다음의 상수들을 정의합니다. 이 확장을 PHP에 내장했거나, 실행시에 동적으로 읽어들일 경우에만 사용할 수 있습니다.

XATTR_ROOT (integer)
Set attribute in root (trusted) namespace. Requires root privileges.
XATTR_DONTFOLLOW (integer)
Do not follow the symbolic link but operate on symbolic link itself.
XATTR_CREATE (integer)
Function will fail if extended attribute already exists.
XATTR_REPLACE (integer)
Function will fail if extended attribute doesn't exist.

Table of Contents