Sadaf
asked on
urgent help needed please
hi!
i am trying to list all my files in a folder..that i can do
but problem is i also want to do this..
if there is a folder inside a folder i want to list all the files in that folder too...
want to list files from inside the folder too,,,
WIN32_FIND_DATA FileData;
HANDLE hFile;
char * fname;
hFile = FindFirstFile(dPath,&FileD ata);
if ( INVALID_HANDLE_VALUE == hFile )
{
puts("No files");
return false;
}
while(true)
{
fname = FileData.cFileName;
puts(fname);
geturl(fname);
if ( 0 == FindNextFile(hFile, &FileData ) )
break;
}
return true;
}
need help...
regards
i am trying to list all my files in a folder..that i can do
but problem is i also want to do this..
if there is a folder inside a folder i want to list all the files in that folder too...
want to list files from inside the folder too,,,
WIN32_FIND_DATA FileData;
HANDLE hFile;
char * fname;
hFile = FindFirstFile(dPath,&FileD
if ( INVALID_HANDLE_VALUE == hFile )
{
puts("No files");
return false;
}
while(true)
{
fname = FileData.cFileName;
puts(fname);
geturl(fname);
if ( 0 == FindNextFile(hFile, &FileData ) )
break;
}
return true;
}
need help...
regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the help..i tried this code ..
i cant figure out how am i suppose to give the path,,,
i tried scan_path("C:\\Documents and Settings"); as well as scan_path("C:\\Documents and Settings\\");
but got error bad name...
how should i give the path,
regards
i cant figure out how am i suppose to give the path,,,
i tried scan_path("C:\\Documents and Settings"); as well as scan_path("C:\\Documents and Settings\\");
but got error bad name...
how should i give the path,
regards
scan_path("C:\\Documents and Settings"); should have worked fine since trailing \\ is being added by the program
I am not too proficient on win ... but try using FindFirstFile in place of _findfirst
I am not too proficient on win ... but try using FindFirstFile in place of _findfirst
oh ... it may be the intervening space in Documents and Settings which may be causing the trouble
try creating a directory without spaces in C:\ and test for it ...
if it works fine, then i think escaping space characters will help
try creating a directory without spaces in C:\ and test for it ...
if it works fine, then i think escaping space characters will help
https://www.experts-exchange.com/questions/10347814/file-and-directory-listing.html