except Exception as err: clear_progress() print('%s[!]%s Failed to extract %s: %s' % (Fore.YELLOW, Fore.RESET, fileobj.current_extraction, err)) pass finally: file = tar.next() # some archives don't seem to have the directories themselves as separate # entries, and this results in lxattrb not being applied to them, which will # lead to bash.exe returning Error: 0x80070002 or 0x8007001f dattrb = lxattrb(stmode.FDIR | 0o755).generate() fattrb = lxattrb(stmode.FREG | 0o755).generate() for root, subFolders, files in os.walk(path): # apply generic root:root 0755 to those without an attribute for folder in subFolders: folder = path_trans(os.path.join(root, folder)) if ntfsea.getattr(folder, 'lxattrb') is None: ntfsea.writeattr(folder, 'lxattrb', dattrb) for file in files: file = path_trans(os.path.join(root, file))
attrb = lxattrb.fromtar(file).generate() ntfsea.writeattr(path_trans(file.name), 'lxattrb', attrb) except Exception as err: clear_progress() print('%s[!]%s Failed to extract %s: %s' % (Fore.YELLOW, Fore.RESET, fileobj.current_extraction, err)) pass finally: file = tar.next() # some archives don't seem to have the directories themselves as separate # entries, and this results in lxattrb not being applied to them, which will # lead to bash.exe returning Error: 0x80070002 or 0x8007001f dattrb = lxattrb(stmode.FDIR | 0o755).generate() fattrb = lxattrb(stmode.FREG | 0o755).generate() for root, subFolders, files in os.walk(path): # apply generic root:root 0755 to those without an attribute for folder in subFolders: folder = path_trans(os.path.join(root, folder)) if ntfsea.getattr(folder, 'lxattrb') is None: ntfsea.writeattr(folder, 'lxattrb', dattrb) for file in files: file = path_trans(os.path.join(root, file))