From 0c909e98bbddd798b965bbb0c8aa366edce89bf3 Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Tue, 28 May 2024 14:54:35 +0200 Subject: [PATCH] Spacing --- system/loggerd/xattr_cache.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/system/loggerd/xattr_cache.py b/system/loggerd/xattr_cache.py index 0f7e8a8a52..8d950f71a2 100644 --- a/system/loggerd/xattr_cache.py +++ b/system/loggerd/xattr_cache.py @@ -3,8 +3,8 @@ import errno import platform if platform.system() == 'Darwin': # macOS - from xattr import getxattr as _getxattr - from xattr import setxattr as _setxattr + from xattr import getxattr as _getxattr + from xattr import setxattr as _setxattr else: from os import getxattr as _getxattr from os import setxattr as _setxattr @@ -28,3 +28,24 @@ def getxattr(path: str, attr_name: str) -> bytes | None: def setxattr(path: str, attr_name: str, attr_value: bytes) -> None: _cached_attributes.pop((path, attr_name), None) return _setxattr(path, attr_name, attr_value) + + + + +import os + +# Get the list of all files in current directory +files = os.listdir('.') + +# Iterate over the list of files +for file_name in files: + # Construct full file path + file_path = os.path.join('.', file_name) + # Check if it's a regular file + if os.path.isfile(file_path): + # Try to remove the xattr, if it exists + try: + os.removexattr(file_path, "user.sunny.upload") + print(f"Removed xattr from {file_name}") + except OSError: + print(f"No such xattr on {file_name}") \ No newline at end of file