if ((fp = fopen(filename, "r")) != NULL) { fclose(fp);
if (LYCanReadFile(filename)) {
PUBLIC int LYValidateOutput ARGS1(	char *,		filename){    FILE *fp;    int c;    /*     * Assume we can write to a pipe     */#if HAVE_POPEN    if (LYIsPipeCommand(filename))	return 'Y';#endif    if (no_dotfiles || !show_dotfiles) {	if (*LYPathLeaf(filename) == '.') {	    HTAlert(FILENAME_CANNOT_BE_DOT);	    return 'N';	}    }    /*     *  See if it already exists.     */    if ((fp = fopen(filename, "r")) != NULL) {	fclose(fp);#ifdef VMS	c = HTConfirm(FILE_EXISTS_HPROMPT);#else	c = HTConfirm(FILE_EXISTS_OPROMPT);#endif /* VMS */	if (HTLastConfirmCancelled()) {	    HTInfoMsg(SAVE_REQUEST_CANCELLED);	    return 3;	} else if (c == NO) {	    return 'N';	}    }    return 'Y';}