Post a reply

Options
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)

Options

Topic review

calatubo

Re: SyncrhonizeDirectories.Removals

martin wrote:

I'll consider adding it.

But you can implement it as easily as:

string[] before = Directory.EnumerateFileSystemEntries(localPath, "*", SearchOption.AllDirectories).ToArray();


session.SynchronizeDirectories(...);

string[] after = Directory.EnumerateFileSystemEntries(localPath, "*", SearchOption.AllDirectories).ToArray();

IEnumerable<string> removals = before.Except(after);


Wow, that's great! Thanks.
martin

Re: SyncrhonizeDirectories.Removals

I'll consider adding it.

But you can implement it as easily as:

string[] before = Directory.EnumerateFileSystemEntries(localPath, "*", SearchOption.AllDirectories).ToArray();


session.SynchronizeDirectories(...);

string[] after = Directory.EnumerateFileSystemEntries(localPath, "*", SearchOption.AllDirectories).ToArray();

IEnumerable<string> removals = before.Except(after);
user2016

martin wrote:

user2016 wrote:

IS there any reason why locally removed files could not be listed?

Well, it's just not implemented yet.


Are there any plans when this will be available?
martin

user2016 wrote:

IS there any reason why locally removed files could not be listed?

Well, it's just not implemented yet.
user2016

IS there any reason why locally removed files could not be listed?
martin

Re: SyncrhonizeDirectories.Removals

There's no way to list local removed files.
calatubo

SyncrhonizeDirectories.Removals

Hello, I'm using this piece of code

Dim synchronizationResult As SynchronizationResult
synchronizationResult = MySession.SynchronizeDirectories(SynchronizationMode.Remote, local, remote, True, True)
For n = 0 To synchronizationResult.Removals.Count - 1
l.WriteLine("Rimosso " + synchronizationResult.Removals(n).FileName)
Next
For n = 0 To synchronizationResult.Failures.Count - 1
l.WriteLine("Errore " + synchronizationResult.Failures(n).Message)
Next

My intention is to log the files that were been removed due exists in remote and not in local. The list contains the files removed and everything is ok.
If I made the reverse synchronization (SynchronizationMode.Local) the files removed in local due are not present in remote, are not listed in .Removals list. The list is empty every time.
Am I mistake something or is there another metodh to retrive the removed files in this case?

Thanks.