Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


I found the answer

The answer is in the file mask, but the documentation doesn't have it exactly correct. The Exact answer is actually in the footnotes of the documentation page, not in the main documentation page.

FileMask consists of file patterns on two sides of a pipe character. If no pipe character is included, it is assumed to all be left-hand side.

(include masks) | (exclude masks)

When I was doing exactly as the docs said, I was explicitly declaring an INCLUDE mask, not an EXCLUDE mask. Changing my filemask to :

tOpts.FileMask = c.SearchPattern + "|*/";

solved the issue.

WInSCP Copies subdirectories, even with the exclude FileMask

I am using Version of the WinSCPnet.dll. In my code, I have the following lines:

TransferOptions tOpts = new TransferOptions();
tOpts.FileMask = "*/";

TransferOperationResult res = sess.PutFiles("S:\\TRANSFER_ME\\*.csv", c.RemotePath, false, tOpts);

Using this code, it SHOULD copy only the root level CSV files. Instead, it copies all CSV files, including those in the "processed" subfolder, which I don't want it to do. Is there any way to copy only the files and not subfolders?? I do not want to copy recursively.