PHP.nl

xattr_list

xattr_list

Get a list of extended attributes

array **xattr_list** string $filename int $flags

This functions gets a list of names of extended attributes of a file.

filenameThe path of the file.

flags

This function returns an array with names of extended attributes.

Voorbeeld: Prints names of all extended attributes of file

<?php
$file = 'some_file';
$root_attributes = xattr_list($file, XATTR_ROOT);
$user_attributes = xattr_list($file);

echo "Root attributes: \n";
foreach ($root_attributes as $attr_name) {
    printf("%s\n", $attr_name);
}

echo "\n User attributes: \n";
foreach ($attributes as $attr_name) {
    printf("%s\n", $attr_name);
}

?>

xattr_get