home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff319.lzh
/
CNewsSrc
/
cnews.src.lzh
/
libc
/
efopen.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-07-05
|
572b
|
32 lines
/*
* efopen - fopen file, exit with message if impossible
*/
#include <stdio.h>
/* imports from libc */
extern char *strcpy(), *strncat();
extern void Error();
static char message[] = "can't open file \"%s\" mode ";
FILE *
efopen(file, mode)
char *file;
char *mode;
{
FILE *fp;
char fullmsg[sizeof(message)+10];
extern int errno;
errno = 0; /* Wipe out residue of earlier errors. */
fp = fopen(file, mode);
if (fp == NULL) {
(void) strcpy(fullmsg, message);
(void) strncat(fullmsg, mode, 10);
Error(fullmsg, file);
/* NOTREACHED */
}
return(fp);
}