From c068b11b60e268d3b7f76c2ffe3cc9a412ff4199 Mon Sep 17 00:00:00 2001 From: Marc Mance Date: Wed, 28 Aug 2024 11:07:38 -0400 Subject: [PATCH] updated removecsv --- collect.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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()