问题
I have mounted a drive.
In it's "Get Info", I have an attribute named Image Disk
The location: /private/var/run/vmware/fuse/10323660103412696815/flat
How can I get this attribute using python?
os.stat
does not give me this.
回答1:
Use the getxattr
function from the xattr
module, which is a Python binding to the native function getxattr(2). For example:
import xattr
print xattr.getattr('/Volumes/MyDrive', 'Image Disk')
See this blog post for a more detailed example.
来源:https://stackoverflow.com/questions/11005303/get-files-get-info-attributes-in-mac-using-python