How do I transfer (or synchronize) directory non-recursively?

Use file mask |*/ to exclude all (sub-)directories.

In scripting, use -filemask switch of respective command (get, put or synchronize) to set the file mask:

put -filemask="|*/" *

With WinSCP .NET Assembly, use TransferOptions.FileMask property to set the file mask:

TransferOptions transferOptions = new TransferOptions();
transferOptions.FileMask = "|*/";
 
session.PutFiles(@"d:\toupload\*", "/home/user/", false, transferOptions);
 
  faq_script_non_recursive.txt · Last modified: by prikryl
 

Search Documentation

This page

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

Associations

Site design by Black Gate