let report_error f =
function
| Unix.Unix_error(err, fun_name, arg) ->
fprintf f "%s: %S failed" Sys.argv.(0) fun_name;
if String.length arg > 0 then
fprintf f " on %S" arg;
fprintf f ": %s" (Unix.error_message err)
| exn -> raise exn