This commit is contained in:
Antonio J. Delgado 2023-01-25 14:53:35 +02:00
parent 865d0c2a96
commit c75d875a27

View file

@ -11,7 +11,7 @@ import logging
import click
import click_config_file
from logging.handlers import SysLogHandler
import hashlib
import zlib
class find_duplicate_files:
@ -45,11 +45,10 @@ class find_duplicate_files:
for file in os.scandir(path):
if not file.name.startswith('.'):
if file.is_file():
hash = hashlib.sha256()
with open(file.path, 'rb') as file_pointer:
file_content = file_pointer.read()
hash.update(file_content)
files[hash.hexdigest()] = file.path
hash = zlib.adler32(file_content)
files[hash] = file.path
elif file.is_dir(follow_symlinks=False):
more_files = self.recursive_scandir(
file.path,