locked
How to listen to the file system to know about the changes?

    Question

  • Hi,

    I want to listen to changes made on a particular directory in my store app. The class FileSystemWatcher is not supported for windows store app .Net framework.

    How can I still achieve this?

    Thanks

    Thursday, September 25, 2014 6:17 AM

All replies

  • You want the CachedFileUpdater class:
    http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.provider.cachedfileupdater.aspx

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, September 25, 2014 7:27 PM
    Moderator
  • I want to listen  the directory C://Users/XXX/MyFolder. Any file/folder created or deleted in this folder should be notified to my app so that I can make appropriate changes in my store app.

    Is this possible using CachedFileUpdater?

    Thanks

    Friday, September 26, 2014 3:33 AM
  • What exactly is your scenario?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, October 3, 2014 6:40 PM
    Moderator
  • I have a page in my app which lists all the files and folders of a particular folder in pictures library.

    Whenever a folder/file is deleted or created in that folder, my app should get notified so that I can refresh the page to show the newly created or deleted folders/files.

    I am currently using this approach : http://lunarfrog.com/blog/2012/10/03/filesystem-change-notifications/

    Please tell me if this the right approach to use or if there is something better than this.

    Thanks 

    Monday, October 6, 2014 8:39 AM