AW> How do you test for what the current directory the user
AW> is using? BTW I'm using BC++ 3.1.
The Borland getcwd() and _getdcwd() functions in BC++3.1
works in both DOS and Windows applications.
It should be in your online help. ( This code is tested :)
// CWD_EX.CPP PUBLIC DOMAIN
#include // for _getdcwd
#include // for getcwd
#include
int main(void)
{
char CurrentWorkingDirectory[256] = "";
if(getcwd(CurrentWorkingDirectory, 255))
{
cout << "On the default drive, your directory is "
<< CurrentWorkingDirectory << endl;
}
else
{
cout << "Default drive not responding." << endl;
}
if(_getdcwd(0, CurrentWorkingDirectory, 255))
{
cout << "On the default drive, your directory is "
<< CurrentWorkingDirectory << endl;
}
else
{
cout << "Default drive not responding." << endl;
}
if(_getdcwd(3, CurrentWorkingDirectory, 255))
{
cout << "On drive C, your directory is "
<< CurrentWorkingDirectory << endl;
}
else
{
cout << "Drive C not responding." << endl;
}
if(_getdcwd(4, CurrentWorkingDirectory, 255))
{
cout << "On drive D, your directory is "
<< CurrentWorkingDirectory << endl;
}
else
{
cout << "Drive D not responding." << endl;
}
return 0;
}
> ] I will not tell my History Teacher to, "Get over it"........
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)
|