Finder shows stale directory listings from NFS server
I had the same problem and found a solution here that worked for me:
dscacheutil -flushcache
killall Finder
The man page of dscacheutil
says that the -flushcache
option should only be used in extreme cases, so there may be risks to this method that I'm not aware of.
I had stale files in Finder when I used noac,nonegnamecache
in the NFS mount options on Yosemite. Removing those options fixed the problem.
Instead of noac
(which is equivalent to actimeo=0
), I added actimeo=1
to set the attribute cache timeout to 1 second. I'd prefer if the attribute cache was disabled completely, but this way at least the timeout is low.
I could confirm that there is such a problem, but it's not been consistent for me. I've just checked against SAMBA and NFS shares on the same server, using the same directories and file for the test. I've had an updated view for both shares in Finder, two times in a row. However, I've experienced the problem as described before. Looks like it happens under more specific conditions.
I do not see this problem using other protocols like AFP or SMB, so the obvious workaround would be to alter the server if we can't isolate / affect Finder's caching. In the mean time, you know this might be one solution if no better solution arises here.