#include #include main (int argc, char *argv[]) { FILE *fp; int c,i; char partfilename[15],*p_partfilename=partfilename; char pathname[60],*p_pathname=pathname; char plotque[15],*p_plotque=plotque; char projnum[3],*p_projnum=projnum; char projnam[20],*p_projnam=projnam; int numcopies, errflg; extern char *optarg; extern int optind, optopt; fp = fopen ("/data/d257/release/projects","r"); if(fp!=0) printf("File opened\n"); else printf("Error opening file \n"); /* numcopies=1; strcpy(p_partfilename,"default.prt"); strcpy(p_pathname,"/data/d257/release"); strcpy(p_plotque,"defaultque"); */ strcpy(p_projnum,"99"); strcpy(p_projnam,"none"); i=0; while (fscanf(fp, "%s %s\n",p_projnum,p_projnam) != EOF) { printf("i= %d %s %s\n",i,p_projnum,p_projnam); ++i; if(i>=15) break; } /* printf("Part Name %s\n",p_partfilename); printf("Path Name %s\n",p_pathname); printf("Plot Que Name %s\n",p_plotque); printf("Number of Copies %d\n",numcopies); printf("Project Number %s \n",p_projnum); */ }