This is the code where i think the error might be occurring, i have read the post about eliminating the error but unable to form the code.
while True:
files=os.listdir(".")
#print(files)
# Get the MD5 hash for each -- use a for loop to process each file
for file_name in files:
with open(file_name , "rb") as fp:
file_content = fp.read()
md5 = hashlib.md5(file_content).hexdigest()
# should we compare the checksums too? XXXXXXXXX
# check for differences between new scan and old scan.
if not file_name in baseline.keys():
# print the name of any new files
print("new file detected!", file_name)
The error specifically is:
Traceback (most recent call last): File "main.py", line 31, in with open(file_name , "rb") as fp: IsADirectoryError: [Errno 21] Is a directory: '.upm'
It'll be of great help if someone can help with the correct code.