All my source code is on a centos virtual machine, which I access over an AFP share.
When I have a file open in TM2, TM is not able to detect that its been changed. This happens often when I switch git branch.
If I open a terminal and run 'ls' on the file, at this point suddenly TM realises its changed and reloads it.
Can anyone offer an explanation for this?
I figured maybe its some form of fstat cache kicking in, either in OSX or due to the way the AFP share has been configured, but I cannot find any other apps behave the same way (ie, Sublime Text detects it has changed immediately)
On 30 Dec 2013, at 23:33, paul chapman wrote:
[…] If I open a terminal and run 'ls' on the file, at this point suddenly TM realises its changed and reloads it.
Can anyone offer an explanation for this?
TextMate asks the OS to notify it about file changes. The local OS does not know when a file gets changed remotely unless the remote host tells it about it (two Macs connected over AFP do seem to communicate such info).
When you “ls” the file you actively probe the remote host and it would appear that the local OS is smart enough to notice that it gets a new version back and will then tell TM that the file has updated.
[…] I cannot find any other apps behave the same way
I’m quite sure there are a lot of apps that use kqueue() like TextMate, but alternatively apps can probe the file system periodically or on certain events (like re-activation) and maybe limit it to only happen for non-local file systems. I won’t rule out that TM 2 will do some of that in the future, but for now, it relies on kqueue().