#define NOCCARGC #include stdio.h #include clib.def /* ** Rename a file. ** from = address of old filename. ** to = address of new filename. ** Returns NULL on success, else ERR. */ rename(from, to) char *from, *to; { char fcb[FCBSIZE]; pad(fcb, NULL, FCBSIZE); if(!_newfcb(to, fcb) || _bdos(OPNFIL, fcb) != 255) { _bdos(CLOFIL, fcb); return (ERR); } if(_newfcb(from, fcb) && _newfcb(to, fcb+NAMEOFF2) && _bdos(RENAME, fcb) != 255) return (NULL); return (ERR); }