I've used the WinSCP .NET assembly to download files from my FTP for a while with a simple FileMask: "|*/"
, as I don't want it to traverse subdirectories. This works well, but now I'm trying to add another filemask to only download files that are have been modified after a certain date, but I'm having issues with using multiple file masks.
Writing it like this, not unexpectedly, just overwrites the FileMask
property on the object:
transferOptions.FileMask = "|*/"; // don't download subdirs
transferOptions.FileMask = "*>=" + date; // only get files updated after date
and using it like this, as people have specified and how it's written in some docs:
transferOptions.FileMask = "|*/"; "*>=" + date;
gives me the error "Only assignment, call, increment, decrement, and new object expressions can be used as a statement."
Is there any other way to separate the two file masks, and make sure both are in usage?
Thanks.
Syntax of WinSCP file mask is
include|exclude
.So you want:
*>=date|*/
In C# code that would be:
See Include and exclude masks.