kmoorthy
asked on
File searching
I would like to get perticular extension of files from root & also from its subdirectories? I want to do this in SDK
ASKER
I want to do it using SDK. I already tried for one directory & it is working in SDK. But in SDK I am not able solve
it from root dirctory.
it from root dirctory.
Send the code you have.
I will give you the Answer.And ask the
Problem clearly.
I will give you the Answer.And ask the
Problem clearly.
ASKER
HANDLE l_hFileFind;
BOOL l_Find ;
l_hFileFind = FindFirstFile("c:/songs/*. txt", &l_FindFileData);
if(l_hFileFind == INVALID_HANDLE_VALUE)
{
MessageBox(hDlg, "Find failed", NULL, NULL);
return TRUE;
}
while(FindNextFile(l_hFile Find, &l_FindFileData) != 0 )
{
MessageBox(hDlg, TEXT(l_FindFileData.cFileN ame ), NULL, NULL);
}
return TRUE;
BOOL l_Find ;
l_hFileFind = FindFirstFile("c:/songs/*.
if(l_hFileFind == INVALID_HANDLE_VALUE)
{
MessageBox(hDlg, "Find failed", NULL, NULL);
return TRUE;
}
while(FindNextFile(l_hFile
{
MessageBox(hDlg, TEXT(l_FindFileData.cFileN
}
return TRUE;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thx. For giving the info.
algorithm.
If you are using MFC use
"CFilefind" class if you are not
using MFC there are equivalent API
calls .Search those API s using
MSDN.
Next using these APIs or class
you will get all the files and directories one bye one for a directory
that you mension.If it is a directory that you have got while searching you
have to do the same recursively.
you can use only the required files
checking extensions and can regect
other files.Make sure you will also
get .&.. files along with other
files,neglect these files also.
If you want the recursive algorithm i
can tell you for increased points,Mean while try to do it for one directory.
Good luck!