Skip to content

Instantly share code, notes, and snippets.

@dreverri
Created July 13, 2010 09:25
Show Gist options
  • Save dreverri/473669 to your computer and use it in GitHub Desktop.
Save dreverri/473669 to your computer and use it in GitHub Desktop.
lists:foldl(fun(F, Acc) ->
case file:open(F, [read, raw, binary]) of
{ok, Io} ->
file:close(Io),
Acc;
{error, Reason} ->
[[{file, F},{error, Reason}]|Acc]
end
end,
[],
filelib:fold_files("data/bitcask", "[0-9]+.bitcask.data", true, fun(F, Acc) -> [F|Acc] end, [])).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment