sp-hydra-veil-gui/SMS-Exchange-Linux-GUI/api_interaction/should_api_be_triggered.py
2026-01-28 13:13:57 +01:00

14 lines
493 B
Python
Executable file

import os
import time
def should_api_be_triggered(file_path, period_of_time):
try:
# Get the last modification time of the file
modification_time = os.path.getmtime(file_path)
# Get the current time
current_time = time.time()
# Check if the file has been modified in the last hour (3600 seconds)
return (current_time - modification_time) <= period_of_time
except FileNotFoundError:
print("File not found.")
return False