How to prevent traversing subfolders

Advertisement

falcon00
Joined:
Posts:
2

How to prevent traversing subfolders

I have a process where I download every existing file in a directory. Say I have:

/readme.txt
/Pub

I only want readme.txt but with ListDirectory I get everything in Pub as well. Is there a way to prevent this drill down behavior?

Reply with quote

Advertisement

falcon00
Joined:
Posts:
2

foreach (RemoteFileInfo fileInfo in directory.Files)
{
if (!fileInfo.IsDirectory)
{
session.GetFiles(remoteFTPDirectory + fileInfo.Name, localPath + fileInfo.Name, false, transferOptions).Check();
}
}

Unless somebody has a better idea.

Reply with quote

Advertisement

You can post new topics in this forum