if (filep->funit & EOFF)
return(TRUE);
else { /* check to see if next is EOF */
iop = filep->fbuf;
c = getc(iop);
if (c == EOF)
return(TRUE);
else {
ungetc(c,iop);
return(FALSE);
}
}
}
bool testwriteaccess(fn)
char *fn;
{
register char *p;
int f;
fn[namelength-1] = ' ';
p=fn;
while (*p++ != ' ');
p--;
*p = '\0';
f = creat(fn,0666); /* we try to create a new file, because
simply testing write access with access(fn,2)
will fail when the file doesn't exist */
*p = ' ';
if (f >= 0) {close(f); return(TRUE);}
else return(FALSE);
}
int flength(filep)
register struct iorec *filep;
{
register FILE *iop; /* stdio-style FILE pointer */
register long pos; /* current file position */
register int len; /* the file length */