|
From: Dondolo M. <MDo...@OL...> - 2003-09-05 13:50:04
|
Can somebody help me with this code. asks you to enter a folder name and
users chdir() to check if the folder does exist.
I am trying to get it to device names and tell me if the device
exist.....eg.
my computer name is AN1490812... so I would like to find out if the divice
name C:\\ does exit on my computer.
Can anybody help?
struct _finddata_t file;
char name[64];
int main(void)
{
cout<<"Enter a folder name :";
cin>>name;
chdir("C:\\");
long flag=0;
if((flag=_findfirst(name,&file))==-1L)
{
cout<<"No matching files\n";
}
else if(file.attrib &_A_SUBDIR)
{
cout<<"\\found \n";
}
system("PAUSE");
return 0;
}
|