Code:
stock AddFolderToDownloadTable(const String:Directory[])
{
decl String:FileName[64], String:Path[512];
new Handle:Dir = OpenDirectory(Directory), FileType:Type;
while(ReadDirEntry(Dir, FileName, Type)
{
if(Type == FileType_Folder)
{
Format(FileName, sizeof(FileName), "%s/%s", Directory, FileName);
AddFolderToDownloadTable(FileName);
continue;
}
if (Type != FileType_File)
{
continue;
}
Format(Path, sizeof(Path), "%s/%s", Directory, FileName);
AddFileToDownloadsTable(Path);
}
return;
}
Hi Fredd. Untested.