PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

xattr_supported> <xattr_remove
Last updated: Fri, 22 Aug 2008

view this page in

xattr_set

(PECL xattr:0.9-1.0)

xattr_set Establece un atributo extendido

Descripción

bool xattr_set ( string $nombre_archivo , string $atributo , string $valor [, int $opciones ] )

La función establece el valor de un atributo extendido del archivo.

Extended attributes have two different namespaces: user and root. The user namespace is available to all users, while the root namespace is available only to users with root privileges. xattr operates on the user namespace by default, but this can be changed with the flags parameter.

Lista de parámetros

nombre_archivo

El archivo al que se establecerá el atributo.

atributo

Nombre del atributo extendido. El atributo se crea si no existe y se reemplaza si ya existía. Se puede modificar este comportamiento con el parámetro opciones .

valor

El valor del atributo.

opciones

Opciones de xattr soportadas
XATTR_CREATE La función falla si el atributo extendido ya existía.
XATTR_REPLACE La función falla si el atributo extendido no existe.
XATTR_DONTFOLLOW Realizar las operaciones en el propio enlace simbólico (no seguirlo).
XATTR_ROOT Establecer atributo en el espacio de nombres raíz (y de confianza). Requiere privilegios de root.

Valores retornados

Devuelve TRUE si todo se llevó a cabo correctamente, FALSE en caso de fallo.

Ejemplos

Example #1 Establecer atributos extendidos en un archivo de extensión .wav

<?php
$archivo 
'mi_cancion_favorita.wav';
xattr_set($archivo'Artista''Algun artista');
xattr_set($archivo'Mi nota''Buena');
xattr_set($archivo'Veces escuchada''34');

/* ... mas codigo ... */

printf("Has escuchado esta cancion %d veces"xattr_get($archivo'Veces escuchada')); 
?>



add a note add a note User Contributed Notes
xattr_set
There are no user contributed notes for this page.

xattr_supported> <xattr_remove
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites