Synchronize -filemask in .NET Assembly?

Advertisement

3K
Donor
Joined:
Posts:
34
Location:
Geneva

Synchronize -filemask in .NET Assembly?

Hi, what is the equivalent scripting command of filemask in .NET Assembly as shown below?

Script:
synchronize -filemask="*.doc*<2012-02-01; *.ppt*<2012-02-01" local "C:\TEST\docs" "/docs"

In .NET assembly, what will be the filemask command?
synchronizationResult =
session.SynchronizeDirectories(
SynchronizationMode.Local, @"C:\TEST\docs", "/docs", false);

Thank you.

Reply with quote

Advertisement

John Thomas
Joined:
Posts:
2
Location:
Malaysia

FileMask with session.PutFiles()

Does the same Filemask syntax apply to session.PutfFiles also?

I need to transfer all the files in a directory without including any sub directories and delete source files on successful transfer.
Will the following code work?

TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FileMask = "*.*| */";

session.PutFiles(source\*, target, true, transferOptions);

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: FileMask with session.PutFiles()

John Thomas wrote:

Does the same Filemask syntax apply to session.PutfFiles also?

I need to transfer all the files in a directory without including any sub directories and delete source files on successful transfer.
Will the following code work?

TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FileMask = "*.*| */";

session.PutFiles(source\*, target, true, transferOptions);
Your code looks good. Any problems?
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum