hackelite01 / hacktoberfest-2024

14 stars 83 forks source link

Added solution for Disk Usage Analyzer #18

Closed pratikj697 closed 1 week ago

pratikj697 commented 1 week ago

introduced the DiskUsageAnalyzer class, which allows users to analyze disk usage within a specified directory. The class scans all files within the directory and subdirectories, collecting their sizes and providing functionality to retrieve the largest files.

Key Features:

  1. Recursive Directory Traversal: Uses os.walk to recursively traverse through the specified directory and its subdirectories, gathering information on all files.
  2. Error Handling: Handles potential exceptions like FileNotFoundError and PermissionError, ensuring the program continues running even if it encounters inaccessible files.
  3. Top N Largest Files: Provides a method to return the largest files, sorted by size.

Benefits:

  1. This implementation allows users to efficiently analyze disk space usage and identify large files that may be taking up unnecessary space. 2.The modular design of the class allows for easy expansion and customization for additional features, such as filtering by file type or size thresholds.

issue #16

hackelite01 commented 1 week ago

Resolves #16

pratikj697 commented 1 week ago

why its get excluded