get_directory_size¶
- get_directory_size(directory)[source]¶
Calculate the total size of a directory in megabytes (MB).
This includes all files in the directory and its subdirectories. Symlinks are ignored to avoid counting linked files or causing errors.
- Parameters:
directory (str) -- Path to the target directory.
- Returns:
float -- Total size of the directory in megabytes.