Removing of files RRS feed

  • Question

  • I am currently trying to sync two folders and the updates and creates are working but deleting of files is ignored. The set up I am using is that I have Folder A and Folder B. I would like to sync up any changes (create, update, delete) in Folder A with Folder B. This seems like a simple procedure that the sync framework would be perfect for except it is not removing the files from Folder B that are deleted in Folder A.

    The code I am using:
    Using sourceProvider As FileSyncProvider = New FileSyncProvider(sourceId.GetGuidId, _sourceDir, syncFilter, FileSyncOptions.None)
    Using destinationProvider As FileSyncProvider = New FileSyncProvider(destinationID.GetGuidId, _destDir, syncFilter, FileSyncOptions.None)
    AddHandler destinationProvider.AppliedChange, AddressOf AppliedChangeCall
    AddHandler destinationProvider.SkippedChange, AddressOf SkippedChangeCall
    AddHandler destinationProvider.SkippedFileDetect, AddressOf SkippedFileDetectCall
    Dim agent As New SyncOrchestrator
    agent.LocalProvider = sourceProvider
    agent.RemoteProvider = destinationProvider
    agent.Direction = SyncDirectionOrder.Upload
    End Using
    End Using
    Any help would be appreciated.
    • Moved by Max Wang_1983 Thursday, April 21, 2011 1:21 AM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Wednesday, July 8, 2009 4:22 PM

All replies

  • Hi Schardag

    I am assuming Folder A is your source and Folder B your destination.  

    To find the issue with your problem, please answer the following set of questions:

    1) What is your "syncFilter"?
    2) What is the language OS (ie. English, German, etc)
    3) Where are Folder A and Folder B located? (ie. local hard disk, usb disk, external hard drive, network storage, etc)
    4) agent.Synchronize() returns a SyncOperationStatistics object, retrieve this object to see the stats for your upload changes, you should have stats.UploadChangesApplied, stats.UploadChangesFailed, and stats.UploadChangesTotal.  See if the files that you deleted on source that fail to get upload equals the total UploadChangesFailed. (This is useful to confirm that the change is being detected) You can also look at the sourceProvider.DetectedChanges to see if deleted files are included in the changes.
    Using stats as SyncOperationStatistics = agent.Synchronize()

    Maria del Mar Alvarez Rohena Microsoft Sync Framework
    Wednesday, July 8, 2009 10:46 PM
  • In additon, on the destinationProvider side, are the SkippedChangeCall and SkippedFileDetectCall being called?

    Maria del Mar Alvarez Rohena Microsoft Sync Framework
    Wednesday, July 8, 2009 10:51 PM