mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
check for filesize and if empty
This commit is contained in:
parent
0107ce569f
commit
2bd8a30812
|
@ -611,7 +611,15 @@ def delete_last_line_from_hmac_list(filepath, position):
|
||||||
|
|
||||||
def check_if_file_exists(path):
|
def check_if_file_exists(path):
|
||||||
try:
|
try:
|
||||||
return os.path.isfile(path)
|
# check if file size is present and filesize > 0
|
||||||
|
if os.path.isfile(path):
|
||||||
|
filesize = os.path.getsize(path)
|
||||||
|
if filesize > 0:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning(
|
log.warning(
|
||||||
"[TNC] [FILE] Lookup failed", e=e, path=path,
|
"[TNC] [FILE] Lookup failed", e=e, path=path,
|
||||||
|
|
Loading…
Reference in a new issue