Skip to content

Instantly share code, notes, and snippets.

@ngerakines
Created July 23, 2008 18:37
Show Gist options
  • Save ngerakines/1843 to your computer and use it in GitHub Desktop.
Save ngerakines/1843 to your computer and use it in GitHub Desktop.
A small erlang snippet to clear ipwcore cache files.
Now = calendar:datetime_to_gregorian_seconds(erlang:universaltime()) - 14400,
DelFun = fun(File, {ok, [{{time, Time}, _}]}) when Time < Now -> file:delete(File); (_, _) -> ok end,
[DelFun(File, file:consult(File)) || File <- filelib:wildcard("cache/*")].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment