diff --git a/collect.py b/collect.py index b9fef82..99cf733 100644 --- a/collect.py +++ b/collect.py @@ -337,10 +337,12 @@ def cleanCSV(): if is_freebsd(): dir = "/var/log" - - for filename in os.listdir(dir): - if filename.endswith(".csv"): # Check for .csv extension - os.remove(filename) + + csv_files = glob.glob(os.path.join(dir, '*.csv')) + + + for filename in csv_files: + os.remove(filename) def collect_csv(): source_dir = os.getcwd()