Windows CIFS Cache Defeat / Forced Update

I modify files on a UNIX system and get their access to a Windows window. The server starts samba and some caching is performed by the client. When I modify a file on the UNIX side, the only reliable way to see the new version of the file is to right-click in Windows Explorer and select "update".

I am looking for the equivalent of the Windows API by right-clicking in Windows Explorer and selecting update. There are still questions about how to send a message to Explorer so that it is updated, but this is not what I want: I am not interested in the contents of the Explorer window, and I would prefer that it does not even need to open its target directory. I just want to integrate the cache distortion effect into my program, so I don’t see outdated data.

+4
source share
1 answer

CIFS includes an update notification system. Explorer is registered for this and will display any changes that Samba sends. I do not know of any other API mechanism to tell Windows that it should update.

Samba supports Linux inotify, so it should automatically receive any changes to the folders that Explorer displays and transfers Explorer updates.

Are you using a recent version of Samba, and Samba was built with inotify support? This is obviously only Linux. For another Unix, you can implement equivalent functionality. The corresponding code is in smbd/notify_internal.c .

+4
source

All Articles