xattr_remove

(PECL xattr >= 0.9.0)

xattr_remove Remove an extended attribute

Descrição

xattr_remove(string $filename, string $name, int $flags = 0): bool

This function removes an extended attribute of a file.

Os atributos estendidos têm dois namespaces diferentes: usuário e root. O namespace de usuário está disponível para todos os usuários, enquanto o namespace de root está disponível apenas para o usuário com privilégios de root. xattr opera no namespace de usuário por padrão, mas isso pode ser alterado com o parâmetro flags.

Parâmetros

filename

The file from which we remove the attribute.

name

The name of the attribute to remove.

flags

Supported xattr flags
XATTR_DONTFOLLOW Do not follow the symbolic link but operate on symbolic link itself.
XATTR_ROOT Set attribute in root (trusted) namespace. Requires root privileges.

Valor Retornado

Retorna true em caso de sucesso ou false em caso de falha.

Exemplos

Exemplo #1 Removes all extended attributes of a file

<?php
$file
= 'some_file';
$attributes = xattr_list($file);

foreach (
$attributes as $attr_name) {
xattr_remove($file, $attr_name);
}
?>

Veja Também

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top