I'm modifying files on a UNIX system and accessing them on a Windows box. The server runs samba and there is some amount of caching done by the client. When I modify the 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 "refresh".
I'm looking for the Windows API equivalent of right-clicking in Windows Explorer and selecting "refresh". There are other questions on SO about sending a message to Explorer to cause it to refresh, but that's not what I want: I don't care about the contents of the Explorer window and I would prefer to not even need one open to the target directory. I just want to integrate the cache-defeating effect into my program so I avoid seeing stale data.
CIFS includes a notification system for updates. Explorer registers for this, and will reflect any changes that Samba sends it. I'm not aware of any other API mechanism to tell Windows that it needs to do a refresh.
Samba supports Linux inotify, so it should automatically pick up any changes to folders that Explorer is displaying and send Explorer updates.
Are you using a recent-enough version of Samba, and has Samba been built with inotify support? This is obviously Linux only. For another Unix, you could implement equivalent functionality. The relevant code is in smbd/notify_internal.c
.