#include "stdio.h" #include "string.h" #include "flatfile.h" /* -------------------------------------------------------------------------- opendata_ro - opens the data file for a certain flatfile, and returns an error code if the file doesn't open. READ ONLY! ----------------------------------------------------------------------------*/ int opendata_ro(char *filename, int lu) { int error; char lfn[100]; strcpy(lfn, filename); ff_pointer[lu] = fopen(strcat(lfn,".dat"),"rb"); if (ff_pointer[lu] == NULL) { error = 1; printf("Error opening data file - does file exist?\n"); } else { error = 0; } return error; }