Copyright © 2019-2021 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
cache_dir/0 | Find the default directory for cache files. |
config_dir/0 | Find the directory with the configuration files. |
config_dir/1 | |
consult/1 | Read a config file, return a list of the contents. |
data_dir/0 | Find the default directory for data files. |
files/1 | List all (regular) files in a directory, skip hidden and temp files. |
files/2 | List all (regular) files in a directory, skip hidden and temp files. |
log_dir/0 | Find the default directory for log files. |
security_dir/0 | Find the default directory for certificates and other secrets. |
cache_dir() -> {ok, file:filename_all()} | {error, term()}
Find the default directory for cache files. Checks the following locations:
If no directory is found then the OS specific directory is used:
config_dir() -> {ok, file:filename_all()} | {error, term()}
Find the directory with the configuration files. Defaults to the OS specific directory for all configurations. This checks a list of possible locations:
In the last three cases subdirectories are also checked, in the following order:
If no directory is found then the OS specific directory with the the major Zotonic version is used. Examples:
config_dir(Node::node()) -> {ok, file:filename_all()} | {error, term()}
consult(File::file:filename_all()) -> {ok, [map() | proplists:proplist()]} | {error, term()}
Read a config file, return a list of the contents. The file can be in erlang, yaml, or json format.
data_dir() -> {ok, file:filename_all()} | {error, term()}
Find the default directory for data files. Checks the following locations:
If no directory is found then the OS specific directory is used:
files(Dir::file:filename_all()) -> [file:filename_all()]
List all (regular) files in a directory, skip hidden and temp files.
files(Dir::file:filename_all(), Wildcard::string()) -> [file:filename_all()]
List all (regular) files in a directory, skip hidden and temp files. Ensures the list of files is sorted in a consistent way.
log_dir() -> {ok, file:filename_all()} | {error, term()}
Find the default directory for log files. Checks the following locations:
If no directory is found then the OS specific directory is used:
security_dir() -> {ok, file:filename_all()} | {error, term()}
Find the default directory for certificates and other secrets. Checks the following locations:
If no directory is found then the OS specific directory with the the subdirectory security is used:
Generated by EDoc