+
+ if (!x->ufnm)
+ {
+ errno = EBADF;
+ return(NO);
+ }
+ if (x->useek)
+ loc=ftell(x->ufd);
+ if (freopen(x->ufnm,mode,x->ufd))
+ {
+ if (x->useek)
+ fseek(x->ufd,loc,0);
+ x->uwrt = (*mode=='a');
+ return(YES);
+ }
+ if (x->ufd = fopen(x->ufnm, (*mode=='a')? "r":"a"))
+ if (x->useek)
+ fseek(x->ufd,loc,0);
+ return(NO);