When I try to download using
session.GetFiles(path) everything is fine and I get all 500 files, but in my case I need to download 125 files out of 500, so I made this method, because I didn't find any ready to go method for such operation in docs, maybe I am wrong tho.
So when I use this method it loses some of my files, for example I constantly get only 118 out of 125 (I tried to test it like 10 times with the same result) and I can't understand why, would be great if I am just wrong and there is a better way to do what I need using docs.
int currentFile = 0;
RemoteDirectoryInfo directory=testSes.ListDirectory(cfgTorrentsPath);
foreach (RemoteFileInfo fileInfo in directory.Files) {
session.GetFiles(path + fileInfo.Name, Directory.GetCurrentDirectory() + @"\folder\"+fileInfo.Name);
if (currentFile >= 125) {
break;
}
currentFile += 1;
}