if the error happens in the middle of writing the file, you'll return a positive value here, and the caller has no easy way of knowing there's been an error...