Remove exit code as we will have already called close
Do not use a buffer - a string is sufficient