def _linux_attr_supported(path): # Expects path to denote a regular file or a directory. if not metadata.get_linux_file_attr: return False try: metadata.get_linux_file_attr(path) except OSError, e: if e.errno in (errno.ENOTTY, errno.ENOSYS, errno.EOPNOTSUPP): return False else: raise