GetFiles with File Mask - WeOnlyDo Discussion board

GetFiles with File Mask (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Limey, Tuesday, September 09, 2014, 16:09 (3726 days ago) @ wodSupport

I'm adding the following event handler that is called executed before each file is downloaded via GetFiles()

WeOnlyDo.Client.SFTP wodSFTP = new WeOnlyDo.Client.SFTP();
wodSFTP.LoopItemEvent += new WeOnlyDo.Client.SFTP.LoopDelegate(wodSFTP_LoopItemEvent);

which then checks each file to see if it should be downloaded.


void wodSFTP_LoopItemEvent(object Sender, WeOnlyDo.Client.SFTP.LoopArgs Args)
{
if (Args.ItemType == WeOnlyDo.Client.SFTP.DirItemTypes.Directory)
{
Args.Skip = false;
}
else
{
//Check remote files for desire extension.
if (Args.RemoteFile.EndsWith(".txt"))
{
Args.Skip = false;
}
else
{
Args.Skip = true;
}

}

}

instead of checking each part of the file separately, I would like to use a mask. Does is support masks? Regular expressions could also do the trick.


Complete thread: