xattr_get
(PECL xattr:0.9-1.0)
xattr_get — Obtiene un atributo extendido
Descripción
string xattr_get
( string $nombre_archivo
, string $nombre
[, int $opciones
] )
La función obtiene el valor de un atributo extendido del archivo.
Extended attributes have two different namespaces: user and root namespace. User namespace is available for all users while root namespace is available only for user with root privileges. xattr operates on user namespace by default, but you can change that using flags argument.
Lista de parámetros
- nombre_archivo
-
El archivo del que se quiere obtener el atributo.
- nombre
-
Nombre del atributo extendido.
- opciones
-
Opciones de xattr soportadas 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 una cadena que contiene el valor del atributo o FALSE si el atributo no existe.
Ejemplos
Example#1 Comprueba si el administrador del sistema ha firmado el archivo
<?php
$archivo = '/usr/local/sbin/ejecutable_binario';
$firma = xattr_get($archivo, 'Root signature', XATTR_ROOT);
/* ... comprobar si la firma es valida ... */
?>