hi
this nirub i want the guideness for deleting the folder and its
files...
here i attached my code deleting file but i cant delete the folder..
if any of one give me idea for that.....
WIN32_FIND_DATA FindFileData;
HANDLE hHandle;
int complt;
char FileName[100];
strcpy(FileName ,"");
char rpath[]="C:\\Sam";
char Path[]="C:\\Sam\\" ;
SetCurrentDirec tory(Path);
hHandle=FindFir stFile("*.*",&F indFileData);
if(hHandle == INVALID_HANDLE_ VALUE)
MessageBox("Pat h NotFound");
else
{
while(complt)
{
strcpy(FileName ,Path);
strcat(FileName ,FindFileData.c FileName);
DeleteFile(File Name);
complt=FindNext File(hHandle,&F indFileData);
}
}
FindClose(hHand le);
int d=RemoveDirecto ry(rpath);
if(d)
MessageBox("Del eted");
else
MessageBox("Sor ry i cant");
int i=CreateDirecto ry(rpath,NULL);
if(i)
MessageBox("Cre ated");
else
MessageBox("Sor ry i cant");
this nirub i want the guideness for deleting the folder and its
files...
here i attached my code deleting file but i cant delete the folder..
if any of one give me idea for that.....
WIN32_FIND_DATA FindFileData;
HANDLE hHandle;
int complt;
char FileName[100];
strcpy(FileName ,"");
char rpath[]="C:\\Sam";
char Path[]="C:\\Sam\\" ;
SetCurrentDirec tory(Path);
hHandle=FindFir stFile("*.*",&F indFileData);
if(hHandle == INVALID_HANDLE_ VALUE)
MessageBox("Pat h NotFound");
else
{
while(complt)
{
strcpy(FileName ,Path);
strcat(FileName ,FindFileData.c FileName);
DeleteFile(File Name);
complt=FindNext File(hHandle,&F indFileData);
}
}
FindClose(hHand le);
int d=RemoveDirecto ry(rpath);
if(d)
MessageBox("Del eted");
else
MessageBox("Sor ry i cant");
int i=CreateDirecto ry(rpath,NULL);
if(i)
MessageBox("Cre ated");
else
MessageBox("Sor ry i cant");
Comment