locked
Restore deleted files in destination directory RRS feed

  • Question

  • I am trying to sync two folders, source to destination, and keep the destination folder the same as the source folder.  I am noticing that when using the code below, that if I delete files in the destination directory, but those files remain in the source directory, the destination directory files are not refreshed.  The only way that I seem to be able to make that behavior occur is to first delete the filesync.meta file in the destination directory.  The problem with this solution is that if there is a file that has merely changed on the destination directory, the source directory is not refreshed with this change.  Is there something that I am doing incorrectly?


    SourceFolder =

    New FileSyncProvider(Me.txtDirectoryFrom.Text, ScopeFilter, FileSyncOptions.None)
    DestinationFolder =
    New FileSyncProvider(Me.txtDirectoryTo.Text, ScopeFilter, FileSyncOptions.None)

     

     

     

    Orchestrator =

    New SyncOrchestrator
    Orchestrator.LocalProvider = DestinationFolder
    Orchestrator.RemoteProvider = SourceFolder
    Orchestrator.Direction = SyncDirectionOrder.Download

    Orchestrator.Synchronize()

    Tuesday, February 23, 2010 4:06 PM

Answers

  • the code is tracking changes on the source directory and not the destination.  also, your syncdirection is download only, so your source directory will never be refreshed with your destination directory changes. deleting the meta file works because you're effectively resetting the sync to fresh sync.
    • Marked as answer by Yunwen Bai Wednesday, February 24, 2010 7:25 AM
    Tuesday, February 23, 2010 5:30 PM

All replies

  • I have a reply on the previous similar question, http://social.microsoft.com/Forums/en-US/syncdevdiscussions/thread/f6493bae-1518-4b2e-b6f5-172586f2ec95.

    Would you mind checking out if it helps?

    Thanks.
    Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, February 23, 2010 5:22 PM
    Answerer
  • the code is tracking changes on the source directory and not the destination.  also, your syncdirection is download only, so your source directory will never be refreshed with your destination directory changes. deleting the meta file works because you're effectively resetting the sync to fresh sync.
    • Marked as answer by Yunwen Bai Wednesday, February 24, 2010 7:25 AM
    Tuesday, February 23, 2010 5:30 PM