[TxMt] Re: Autoreoad modified file not working over an AFP share

Allan Odgaard mailinglist at textmate.org
Sun Jan 5 10:20:36 UTC 2014


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().


More information about the textmate mailing list