11696Smckusick /* Copyright (c) 1979 Regents of the University of California */
21696Smckusick 
3*3027Smckusic static char sccsid[] = "@(#)REWRITE.c 1.2 03/07/81";
41696Smckusick 
51696Smckusick #include "h00vars.h"
61696Smckusick #include "h01errs.h"
71696Smckusick 
81696Smckusick REWRITE(filep, name, maxnamlen, datasize)
91696Smckusick 
101696Smckusick 	register struct iorec	*filep;
111696Smckusick 	char			*name;
12*3027Smckusic 	long			maxnamlen;
13*3027Smckusic 	long			datasize;
141696Smckusick {
151696Smckusick 	filep = GETNAME (filep, name, maxnamlen, datasize);
161696Smckusick 	filep->fbuf = fopen(filep->fname, "w");
171696Smckusick 	if (filep->fbuf == NULL) {
181696Smckusick 		ERROR(ECREATE, filep->pfname);
191696Smckusick 		return;
201696Smckusick 	}
211696Smckusick 	filep->funit |= (EOFF | FWRITE);
221696Smckusick 	if (filep->fblk > PREDEF) {
231696Smckusick 		setbuf(filep->fbuf, &filep->buf[0]);
241696Smckusick 	}
251696Smckusick }
26