|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 512 (0x200)
Types: TextFile
Names: »openread.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec8/cfs/openread.c«
/*
* openread - open a file for exclusive read; bomb if unsuccesful
*/
#include <stdio.h>
#include <sys/file.h>
FILE *
openread (file)
char *file;
{
extern char *myname;
FILE *fp;
fp = fopen (file, "r");
if (fp == NULL) {
fprintf (stderr, "%s: can't open %s for reading\n", myname, file);
exit (1);
}
if (flock (fileno (fp), LOCK_EX | LOCK_NB)) {
fprintf (stderr, "%s: statfile %s is in use and locked\n",
myname, file);
exit (1);
}
rewind(fp);
return (fp);
}