Module zotonic_filewatcher_inotify

Watch for changed files using inotifywait.

Copyright © 2011-2015 Arjan Scherpenisse <arjan@scherpenisse.net> Date: 2011-10-12

Behaviours: gen_server.

Authors: Arjan Scherpenisse (arjan@scherpenisse.net).

Description

Watch for changed files using inotifywait. https://github.com/rvoicilas/inotify-tools/wiki

Function Index

code_change/3Convert process state when code is changed.
handle_call/3Trap unknown calls.
handle_cast/2
handle_info/2Reading a line from the inotifywait program.
init/1Initiates the server.
is_installed/0
restart/0
start_link/0Starts the server.
terminate/2This function is called by a gen_server when it is about to terminate.

Function Details

code_change/3

code_change(OldVsn, State, Extra) -> {ok, NewState}

Convert process state when code is changed

handle_call/3

handle_call(Message, From, State) -> any()

Trap unknown calls

handle_cast/2

handle_cast(Message::Msg, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

handle_info/2

handle_info(Info, State) -> any()

Reading a line from the inotifywait program. Sets a timer to prevent duplicate file changed message for the same filename (e.g. if a editor saves a file twice for some reason).

init/1

init(X1::Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}

Initiates the server.

is_installed/0

is_installed() -> boolean()

restart/0

restart() -> ok

start_link/0

start_link() -> {ok, pid()} | ignore | {error, term()}

Starts the server

terminate/2

terminate(Reason, State) -> void()

This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.


Generated by EDoc