1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

ignore ._ files for real

This commit is contained in:
Alex Xu
2025-05-25 11:32:41 -07:00
parent 7b8858678f
commit 8da2b4cb96

View File

@@ -836,6 +836,10 @@ def sanitizePermissions(filetree):
os.chmod(os.path.join(root, name), S_IWRITE | S_IREAD)
for name in dirs:
os.chmod(os.path.join(root, name), S_IWRITE | S_IREAD | S_IEXEC)
for root, dirs, files in os.walk(filetree, False):
for name in files:
if name.startswith('._'):
os.remove(os.path.join(root, name))
def chunk_directory(path):
@@ -940,7 +944,8 @@ def detectSuboptimalProcessing(tmppath, orgpath):
raise RuntimeError('Image file %s is corrupted. Error: %s' % (pathOrg, str(err)))
else:
try:
os.remove(os.path.join(root, name))
if os.path.exists(os.path.join(root, name)):
os.remove(os.path.join(root, name))
except OSError as e:
raise RuntimeError(f"{name}: {e}")
# remove empty nested folders