none
How FileSyncProvider handles Rename of a file/directory in MSF? RRS feed

  • Question

  • In Microsoft Sync Framework, How the rename operation is handled by FileSyncProvider?

    I am creating a custom File Sync Application.

    I want to track changes made to a file, but If file on source has been renamed, how can I check that?

    Please Help!!!

    • Moved by SamAgain Tuesday, June 22, 2010 6:53 AM better fit (From:.NET Base Class Library)
    Tuesday, June 22, 2010 3:59 AM

Answers

  • Ajmera, what provider are you implementing ? KnowledgeSyncProvider or Fullenumeration ? If you use KnowledgeSyncProvider, you will have to handle the functinoality to detect which items (in your case files) have been deleted/upated/created etc. If you are using the Full Enumeration provider, you only need to report what you currently have (i.e. just enumerate ALL your items), and the sync engine will handle the logic for you.

    Also, may we please know what are the reasons why you are *not* using the File Provider we provided? Is there some functinoality missing or you've hit some issues with our bits?

    Adrian

    • Marked as answer by Ajmera Friday, July 23, 2010 7:21 AM
    Monday, June 28, 2010 4:06 AM
  • Hi Adrian,

    Sorry for the delayed reply.

    No, there is nothing missing from File Provider from MSF.

    I just wanted to implement my own for learning purpose, because later I need to implement sync providers for many kind of data stores.

    I have implemented File Sync Provider using  the Full Enumeration provider, and its working fine.

    Thanks for your kind reply.

    I hope we'll be having good discussions on MSF later.

    Regards,

    Ajmera

    • Marked as answer by Ajmera Friday, July 23, 2010 7:21 AM
    Thursday, July 1, 2010 5:44 AM

All replies

  • afaik, you dont have to do anything. File renames are handled automatically. Sync Fx acts as if the original file was deleted and a new one was created.

    if you want to check the type of change, you can subscribe to the the ApplyingChange event. The ApplyingChangeEventArgs.ChangeType will tell yo what type of change is about to be applied and you can check if its a rename.

    Tuesday, June 22, 2010 10:39 AM
    Moderator
  • Thanks for the reply.

    Can you please give a sample code. 

    That will be more helpful.

     

    Thanks,

    Ajemra

    Tuesday, June 22, 2010 11:38 AM
  • Ajmera,

    you may want to check the following link to get some samples and more info on the File Sync Provider  - http://msdn.microsoft.com/en-us/sync/bb887623.aspx

    please let us know if you encounter any issues or have more questions.

    Adrian

    Tuesday, June 22, 2010 7:24 PM
  • Hi Adrian,

    It was helpful but I am creating my own sync provider for file synchronization.

    I have got stuck where I need to check what updates has been done on source.

    Do I have to first check source for updates(all files and directories) and update the metadata of source each time before synchronization?

     

    Thanks,

    Ajmera

    Wednesday, June 23, 2010 4:15 AM
  • Ajmera, what provider are you implementing ? KnowledgeSyncProvider or Fullenumeration ? If you use KnowledgeSyncProvider, you will have to handle the functinoality to detect which items (in your case files) have been deleted/upated/created etc. If you are using the Full Enumeration provider, you only need to report what you currently have (i.e. just enumerate ALL your items), and the sync engine will handle the logic for you.

    Also, may we please know what are the reasons why you are *not* using the File Provider we provided? Is there some functinoality missing or you've hit some issues with our bits?

    Adrian

    • Marked as answer by Ajmera Friday, July 23, 2010 7:21 AM
    Monday, June 28, 2010 4:06 AM
  • Hi Adrian,

    Sorry for the delayed reply.

    No, there is nothing missing from File Provider from MSF.

    I just wanted to implement my own for learning purpose, because later I need to implement sync providers for many kind of data stores.

    I have implemented File Sync Provider using  the Full Enumeration provider, and its working fine.

    Thanks for your kind reply.

    I hope we'll be having good discussions on MSF later.

    Regards,

    Ajmera

    • Marked as answer by Ajmera Friday, July 23, 2010 7:21 AM
    Thursday, July 1, 2010 5:44 AM