Click here to Skip to main content
16,004,782 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i need to scan a drive for eg drive F i want to scan all folders which means subfolders
so it needs to be a recursive function so that it can itrate over every subfolder in a folder and get the names and path of these specific .mp3 files and save in a text file
its very easy to do in linux but unfortunately i have to do this on window i know i need t use wind32 api and use findFirstFile function and etc
looking forard for answer
for now i have this code only

What I have tried:

BOOL WINAPI rd_cb(TCHAR *file_path, VOID *param)
{
TCHAR *exts;
exts = param;
while (*exts) {
TCHAR *cur_ext;
cur_ext = PathFindExtension(file_path);
if (cur_ext) {
if (_tcscmp(cur_ext, exts) == 0) {
/* do what you want here with the file */
/* printf as an example here */
_tprintf(TEXT("%s\n"), file_path);
}
}
++exts;
}

return TRUE;
}
Posted
Updated 19-Feb-20 18:24pm
v2

1 solution

I would start with the sample code gently provided by The Documentation[^].
 
Share this answer
 
Comments
OriginalGriff 14-Feb-20 3:28am    
A very polite RTFM! :)
CPallini 14-Feb-20 3:44am    
"i already have read all the microsoft documentation regarding this"
Then you are more than competent to write the recursive variant of such code sample.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900