Module z_file_mtime

Keep a registration of file modification times, especially for z_template.

Copyright © 2015-2017 Marc Worrell <marc@worrell.nl>

Behaviours: gen_server.

Authors: Marc Worrell (marc@worrell.nl).

Description

Keep a registration of file modification times, especially for z_template

Function Index

code_change/3Convert process state when code is changed.
file_mtime/1Return the (universal) modification time of file, 0 on enoent.
flush_site/1Invalidate all templates of a whole site.
handle_call/3
handle_cast/2
handle_info/2
init/1Initiates the server.
insert_template/2Insert a template and its dependencies.
is_template_modified/2Check if a template is marked as modified.
modified/1Mark a file as modified.
mtime/1Return the modification time of a file.
simplify/1
start_link/0
start_link/1Starts the server.
terminate/2

Function Details

code_change/3

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

Convert process state when code is changed

file_mtime/1

file_mtime(File::file:filename_all()) -> calendar:datetime() | 0

Return the (universal) modification time of file, 0 on enoent

flush_site/1

flush_site(Site) -> any()

Invalidate all templates of a whole site

handle_call/3

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

handle_cast/2

handle_cast(Message, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1::list()) -> {ok, #state{is_scanner_enabled = boolean()}}

Initiates the server.

insert_template/2

insert_template(Module, CompileTime) -> any()

Insert a template and its dependencies

is_template_modified/2

is_template_modified(Module, Site) -> any()

Check if a template is marked as modified

modified/1

modified(File::string() | binary()) -> ok

Mark a file as modified

mtime/1

mtime(File::file:filename_all()) -> {ok, calendar:datetime()} | {error, notfound}

Return the modification time of a file

simplify/1

simplify(Path) -> any()

start_link/0

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

start_link/1

start_link(IsScannerEnabled::boolean()) -> {ok, pid()} | {error, term()}

Starts the server. IsScannerEnabled is set if inotify, fswatch or the periodic directory scanner is enabled. If not then the cached mtimes are periodically flushed.

terminate/2

terminate(Reason, State) -> any()


Generated by EDoc