Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🧹 Folder Cleaner – Capstone Project

A high-performance C++ command-line utility that identifies and removes old or empty files from folders.


👨‍💻 Author

  • Vansh Vora

🚀 Features

  • 🧼 Detects and deletes:
    • Completely empty files (0 bytes)
    • Files older than a set threshold (measured in months)
  • 🖥️ High-Performance Concurrent Design: Uses a thread pool (std::thread), lock structures (std::mutex, std::condition_variable), and atomics (std::atomic) to process files concurrently.
  • Modern Standards: Built utilizing C++17 std::filesystem for real cross-platform directory traversal and file manipulation.

🛠️ Tech Stack

  • Language: C++17
  • Standard Libraries: <filesystem>, <thread>, <mutex>, <atomic>, <queue>
  • Architecture: Concurrent CLI Application with Task Queues
  • Build System: CMake

📌 Compilation

Option 1: Using CMake (Recommended)

This project uses CMake, the industry standard for C++ build systems.

# 1. Create a build directory
mkdir build
cd build

# 2. Generate build files
cmake ..

# 3. Compile the project
cmake --build .

Option 2: Using g++ Directly

If you don't have CMake installed, you can compile the single file directly using g++. Ensure you link the threading library (-pthread):

g++ -std=c++17 main.cpp -o folderCleaner -pthread

💻 Usage

This utility features a Dual-Mode CLI, catering to both automated servers and regular users.

1. Interactive User Mode

If you run the executable by double-clicking it or running it with no arguments, it will launch a friendly, interactive menu:

./folderCleaner

2. Automated Server Mode

If you pass arguments, it runs instantly without pausing for input, which is perfect for scheduled server automation.

Show Help Menu:

./folderCleaner --help

Clean a folder (Files older than 3 months):

./folderCleaner -p "C:/Path/To/Your/Folder"

Clean a folder (Files older than 6 months AND empty files):

./folderCleaner -p "C:/Path/To/Your/Folder" -m 6 -e

Options:

  • -p, --path <dir> : The directory path to clean (Required)
  • -m, --months <num> : Minimum age in months for files to be deleted (Default: 3)
  • -e, --empty : Also delete completely empty files (0 bytes)
  • -h, --help : Show help message and exit

📄 License

This project is for educational purposes under the university's capstone program.


About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages