getDirectorySize

Calculates the total size of a directory recursively, including all files and subdirectories.

Return

The total size of the directory in bytes.

Parameters

dir

The directory to calculate the size of.