开发者

How to enable the libattr frature(abbreviated xattr) in linux?

开发者 https://www.devze.com 2023-01-11 05:29 出处:网络
I want to use xattr in python, but found the xattr\'s keys() is empty, does that indicate the libattr feature wasn\'t enabled?

I want to use xattr in python, but found the xattr's keys() is empty, does that indicate the libattr feature wasn't enabled? I've learned the libattr feature is disabled in ext3/ext4 by default, but how to enable it? Expect your help! Thank you~

>>> import xattr
>>> x = xattr.xattr('tiger_8a428_userdvd.dmg开发者_开发知识库')
>>> x
<xattr file='tiger_8a428_userdvd.dmg'>
>>> x.keys()
[]


Maybe you can use the following:

>>> x = xattr.get_all('tiger_8a428_userdvd.dmg')

Should be better.

0

精彩评论

暂无评论...
验证码 换一张
取 消