home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
SMC21LIB.LZH
/
RENAME.C
< prev
next >
Wrap
Text File
|
2000-06-30
|
640b
|
27 lines
#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