fopen error checking