Skip to content

Instantly share code, notes, and snippets.

@rzezeski
Created January 12, 2012 20:38
Show Gist options
  • Save rzezeski/1602953 to your computer and use it in GitHub Desktop.
Save rzezeski/1602953 to your computer and use it in GitHub Desktop.
check luwak file ancestor
{ok, C} = riak:local_client().
{ok, F} = luwak_file:get(C, <<"filename">>).
PrevRoot = hd(luwak_file:get_property(F, ancestors)).
V = riak_object:get_value(F).
V2 = lists:keyreplace(root, 1, V, {root, PrevRoot}).
TempF = riak_object:apply_updates(riak_object:update_value(F, V2)).
Bytes = luwak_io:get_range(C, TempF, 0, Length). % where Length is number of bytes you want to read
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment