Skip to content

kxngHADES/File-size-checkers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation


Large File Scanner

This script scans a specified directory and its subdirectories for files larger than a specified size and prints their paths and sizes in a human-readable format.

Requirements

  • Python 3.6+
  • os module (standard library)
  • humanize module

Installation

  1. Clone or download this repository.

  2. Install the required humanize module if you don't have it already:

pip install humanize

Usage

  1. Open the script file (large_file_scanner.py) in a text editor.

  2. Modify the min_size and path variables in the if __name__ == "__main__": block to suit your needs:

    • min_size: The minimum file size to look for, specified in megabytes (MB). The default is set to 2048 MB (2 GB).
    • path: The directory path to scan. The default is set to C:\\ (the C drive on Windows). Change this to the drive or directory you want to scan.
    if __name__ == "__main__":
        min_size = 2048 * 1024 * 1024  # This is the size in MB
        path = "C:\\"  # Change this to the directory you want to scan
  3. Save the changes and run the script:

python large_file_scanner.py
  1. The script will output the number of large files found and list them with their paths and sizes.

Example Output

Scanning for large files...
Found 5 files larger than 2.0 GB:
C:\path\to\largefile1: 2.1 GB
C:\path\to\largefile2: 2.5 GB
...

Error Handling

The script handles FileNotFoundError and PermissionError exceptions that may occur during file size retrieval. If these errors are encountered, the script will skip the problematic files and continue scanning.

Contributing

Feel free to open issues or submit pull requests if you have suggestions or improvements.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages