Robust method to print file size