Hi, When i tried to use
{ok, File} = luwak_file:create(Riak, <<"file1">>, dict:new()), Size = luwak_file:length(Riak, File), io:format("Size is ~p bytes~n", [Size]), {ok, _, File1} = luwak_io:put_range(Riak, File, 0, <<"1234567890">>), Size1 = luwak_file:length(Riak, File1), io:format("Size is ~p bytes~n", [Size1]), %%create this file again {ok, File2} = luwak_file:create(Riak, <<"file1">>, dict:new()), Size2 = luwak_file:length(Riak, File2), io:format("Size is ~p bytes~n", [Size2]), %%write data at pos 100 which is invalid offset, but it works, why? {ok, _, File3} = luwak_io:put_range(Riak, File2, 100, <<"abcdefg">>), Size3 = luwak_file:length(Riak, File3), io:format("Size is ~p bytes~n", [Size3]). result: Size is 0 bytes Size is 10 bytes Size is 10 bytes Size is 107 bytes ok I tried many times and found seems like as long as i did these operation using the same Riak connection, it will show results above. but when i used another Riak connection({ok, Riak} = riak:client_connect('riak@127.0.0.1'). ), it will truncate file contents. Is this the supposed result? Best regards Fisher
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com