Check fopen return value