Use File.size to ensure file is closed