Initial commit

This commit is contained in:
2026-10-01 13:25:32 -04:00
commit 959d957068
5 changed files with 42 additions and 0 deletions

0
libs/__init__.py Normal file
View File

27
libs/filesearch.py Normal file
View File

@@ -0,0 +1,27 @@
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from pathlib import Path
downloads_path = Path.home() / "Downloads"
class NewFileHandler(FileSystemEventHandler):
def on_created(self, event):
if not event.is_directory:
print(f"New file detected: {event.src_path}")
if __name__ == "__main__":
path_to_watch = downloads_path
event_handler = NewFileHandler()
observer = Observer()
observer.schedule(event_handler, path=path_to_watch, recursive=False)
print(f"Monitoring folder: {path_to_watch}...")
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()

11
libs/hashchecker.py Normal file
View File

@@ -0,0 +1,11 @@
import hashlib
def hashcheck(fileToCheck):
with open(fileToCheck, "rb") as f:
digest = hashlib.file_digest(f, "sha256")
file_hash = digest.hexdigest()
print(file_hash)
hashcheck("ha.txt")