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