Skip to content

Instantly share code, notes, and snippets.

process_file(StatusFileName, Table) ->
FileName = ?STATUS_FILES_DIR ++ StatusFileName,
{ok, IoD} = file:open(FileName, read),
HttpURL = io:get_line(IoD, ''),
file:close(IoD),
{ok, {{_Version, 200, ReasonPhrase}, _Headers, _Body}} = httpc:request(HttpURL),
file:delete(FileName),
ets:insert(Table, {StatusFileName, -1}).
do_process() ->