home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
273_01
/
chgto.cc
< prev
next >
Wrap
Text File
|
1988-04-11
|
910b
|
27 lines
#include <dir.h>
change_to(char *dir)
/*
┌────────────────────────────────────────────────────────────────────┐
│Purpose: To change the current disk drive and directory with │
│ one call. │
│ Inputs: Char *dir points to directory to change to. This may │
│ contain a drive letter if required. │
│Outputs: None. │
│ │
│ Return: 0 = successful. │
│ -1 = directory not found. │
└────────────────────────────────────────────────────────────────────┘
*/
{
char disk;
if(*(dir + 1) == ':') {
disk = *dir;
disk = toupper(disk);
setdisk(disk - 'A');
}
return(chdir(dir));
}