Erlang Snippet: Remove stale iplaywow cache files

| | Comments (0)

Now = calendar:datetime_to_gregorian_seconds(erlang:universaltime()), [begin {ok, [{{time, Time}, _}]} = file:consult(File), case Time < Now - 14400 of true -> file:delete(File); _ -> ok end end || File <- filelib:wildcard("cache/*")].

Updated This snippet now lives in gist: http://gist.github.com/1843

Leave a comment

About this Entry

This page contains a single entry by Nick Gerakines published on July 16, 2008 7:10 PM.

I Play WoW updated to use s3images was the previous entry in this blog.

I Play WoW on CouchDB is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.