LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can not set a relative diretory

Hello

I use this sentence to set a relative : SetDir("..\\Data") , but always get an error , what is wrong ? My CVI is 6.0 , and OS is Win 2000.

David
0 Kudos
Message 1 of 3
(3,101 Views)
What error are you getting?
Are you sure you're in the right directory (Data's parent) before you call SetDir?
I have CVI 6.0 and Win2K, but I couldn't duplicate your problem.
Try a simple program like this, changing the directories to match your directories.
#include
#include
main()
{
int localErr;
char newDir[260];
localErr = SetDir ("c:\\my documents\\cvi projects\\test");
printf("SetDir error = %d\n", localErr);
localErr = GetDir (newDir);
printf("GetDir error = %d\n"
"Current directory = %s\n",
localErr, newDir);

localErr = SetDir ("..\\temp");
localErr = GetDir (newDir);
printf("GetDir error = %d\n"
"Current directory = %s\n"
"\nPress Enter to continue...\n",
localErr, newDir);
gets(newDir);
}
0 Kudos
Message 2 of 3
(3,101 Views)
AIS ,

Sorry , I make a stupid error , the directory of "Data" is a subdirectory relative to the current project ,so can not use "SetDir("..\\Data")" to redirect . Thanks.

David
0 Kudos
Message 3 of 3
(3,101 Views)