how to watch changes in a file

note: the behavior is different in windows that in normal *nix systems