anchor.diff:  -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
   -export([start_link/1]).
   
  --record(state, {port, context, timers=[]}).
  +-record(state, {port, executable, context, timers=[]}).
   
   %% interface functions
   -export([
  
positive.code: %% @doc Trap unknown casts
  handle_cast(Message, State) ->
      {stop, {unknown_cast, Message}, State}.
  
  
  
  
  %% @doc Reading a line from the inotifywait program. Sets a timer to
  
negative.code: %% support functions
  %%====================================================================
  
  start_inotify(State=#state{executable=Executable}) ->
      os:cmd("killall inotifywait"),
      Args = ["-q", "-e", "modify,create", "-m", "-r", 
              filename:join(os:getenv("ZOTONIC"), "src"),
              filename:join(os:getenv("ZOTONIC"), "priv/sites"),
              filename:join(os:getenv("ZOTONIC"), "modules")
              |
              string:tokens(os:cmd("find " ++ z_utils:os_escape(os:getenv("ZOTONIC")) ++ " -type l"), "\n")],
      Port = erlang:open_port({spawn_executable, Executable}, [{args, Args}, {line, 1024}]),
      State#state{port=Port}.
  
  
  verb("MODIFY") -> modify;
  verb("CREATE") -> create.
  
  