check if output file can be opened and written to