flush the output
output start/end group as tap diagnostics
output errors as diagnostic messages
try to create ancestor directories of the tap file