Better file size calculation

Reduce the file size code down to a simple 1-liner. Props
https://github.com/MetalFrog