home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name drrename -- Rename a file (on same drive)
- *
- * Synopsis ercode = drrename(pold,pnew)
- *
- * int ercode DOS error code
- * char *pold Previous filename
- * char *pnew New filename
- *
- * Description This function changes the name of one file to another.
- * Path names may be used, but cannot contain wildcard
- * characters ('*' or '?') or specify different disk
- * drives. (By using path names, files can be efficiently
- * moved from one directory to another on the same disk
- * drive.)
- *
- * Returns ercode DOS error code
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <bdirect.h>
- #include <butility.h>
-
- int drrename(pold,pnew)
- char *pold,*pnew;
- {
- DOSREG dos_reg;
- ADS name_ads;
-
- dos_reg.ax = 0x5600;
- utabsptr(pold,&name_ads);
- dos_reg.ds = name_ads.s;
- dos_reg.dx = name_ads.r;
- utabsptr(pnew,&name_ads);
- dos_reg.es = name_ads.s;
- dos_reg.di = name_ads.r;
-
- return(dos(&dos_reg));
- }