Created
July 23, 2008 18:37
-
-
Save ngerakines/1843 to your computer and use it in GitHub Desktop.
A small erlang snippet to clear ipwcore cache files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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