home *** CD-ROM | disk | FTP | other *** search
-
- #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);
- }
-
- ,005,006,007,008,009,
- 010,011,012,013,014,015,016,017,018,019,
- 020,021,022,023,024,025,026,027,02