locked
How to perform rename operation by using simple custom providers? RRS feed

  • Question

  • Hi,

    Recently, I have studied the ManagedNTFSProvider program which is located in C:\Program Files (x86)\Microsoft SDKs\Microsoft Sync Framework\v2.0\Samples\NTFSSample. It's a sample program that shows us how we can use simple custom providers to synchronizes files in a folder pair.

    I have a folder pair (folder A and B) that each contains the file aa.txt after synchronization. Then I renamed aa.txt to bb.txt in folder A, and I ran the program step by step. I found that the rename operation was considered as delete and create operation in the progress of synchronization. How can I just rename aa.txt of folder B without delete it and create bb.txt by this provider?

    • Moved by Max Wang_1983 Thursday, April 21, 2011 1:14 AM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Monday, August 3, 2009 10:43 AM

Answers

  • Hi, Jeff.
    A rename appears as a delete/create because it's the file name (path) which is used as an item identifier. So, what you literally say is "item with id "aa" has been deleted, and a new file with id "bb" has been created", and this is what the sync engine understands.
    I think that if you were to implement your own file provider, where the file name would be a property, not an identifier (I guess the ID-path mapping in this case would be difficult to keep track of), then the rename would propagate as a simple rename.

    hope this helps.

    Adrian
    Tuesday, August 11, 2009 7:01 PM