xattr_list() 函數可以獲得擴展屬性列表。
用法
array xattr_list( string $filename [, int $flags = 0 ] )
xattr_list() 函數可以獲取文件的擴展屬性名稱列表。
擴展屬性有兩個不同的命名空間:user 和 root。用戶命名空間可供所有用戶使用,而根命名空間僅適用於具有 root 權限的用戶。默認情況下,xattr 可以對用戶命名空間進行操作,但我們可以使用 flags 參數更改它。
xattr_list() 函數可以返回一個包含擴展屬性名稱的數組。
示例
<?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);
}
?>
相關用法
- PHP xattr_set()用法及代碼示例
- PHP xattr_remove()用法及代碼示例
- PHP xattr_get()用法及代碼示例
- PHP xattr_supported()用法及代碼示例
- PHP xmlwriter_end_dtd_attlist()用法及代碼示例
- PHP xmlwriter_end_dtd_element()用法及代碼示例
- PHP xdiff_file_diff_binary()用法及代碼示例
- PHP xml_get_current_column_number()用法及代碼示例
- PHP xmlwriter_write_dtd()用法及代碼示例
- PHP xdiff_file_rabdiff()用法及代碼示例
- PHP xmlwriter_full_end_element()用法及代碼示例
- PHP xmlwriter_end_document()用法及代碼示例
- PHP xmlwriter_end_comment()用法及代碼示例
- PHP xmlwriter_start_cdata()用法及代碼示例
- PHP xmlwriter_end_element()用法及代碼示例
- PHP xdiff_string_rabdiff()用法及代碼示例
- PHP xml_parser_free()用法及代碼示例
- PHP xmlwriter_end_dtd()用法及代碼示例
- PHP xml_get_current_byte_index()用法及代碼示例
注:本文由純淨天空篩選整理自 PHP - xattr list() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。