I just want to follow up on Kurt's question, as this is a serious issue for us and we will need to find a solution.
Note that it's very easy to replicate this situation using the Mapper sample with the SDK:

Code

1. Mount the filesystem (e.g. Z:\ -> C:\1)
2. Create a text file on Z: with notepad with the contents "1234", and close the file
3. Edit the same text file on C:\1 with the contents "12345678" save the file. This simulates the file being "changed" outside of the CBFS filesystem (e.g. on a network or database)
4. Open the file on Z: - you'll still see 1234

The NotifyDirectoryChange mechansim isn't a good solution. In almost any case where the filesystem is stored in a database or on a network file system you won't know that a file has changed until you get a request to open it - at which point it's too late to call NotifyDirectoryChange.

Obviously there is a way for you to clear the Windows cache of this data, since you do it in NotifyDirectoryChange.
Would it be possible to add a flag so that the cache is cleared for a file every time the file is opened (before calling into our callback)? While that may impact performance, for shared filesystems it's the only way to ensure consistency. The option could be off for those developing just local filesystems.

Dave Wright wrote:
In my testing with Mapper AddNetworkMountingPoint had no effect on the issue.

That's strange. Anyway, first network redirector will be completed, and maybe the problem will go away (at least for AddNetworkMountingPont() call). If no, Vladimir will modify NotifyDirectoryChange functionality.

When I call i.e. NotifyDirectoryChange(L"\\a\\b\\c.txt", CallbackFileSystem::fanModified) from other thread it always hangs up...
When I call it from the same thread (which hosts CBFS callbacks), even from callback method (I know this is wrong - I did it only for test) its OK.
I use VC++ and 32bit Win XP Professional.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.