loading erlang terms

2010-10-25 Thread Charles Blair
Erlang has a function, file:consult, that allows one to load erlang terms from a file. Is there a content type I can use when I'm loading data from disk using curl that ensures that what I'm loading are interpreted as erlang terms, not strings? ___ riak-

Re: loading erlang terms

2010-10-26 Thread Charles Blair
On Mon, Oct 25, 2010 at 07:34:13PM -0700, Dan Reverri wrote: > I don't understand your use case; can you expand on what you are doing? Perhaps this in the category of "too much information," but since you asked, I had written an OAI-PMH provider in erlang. My backing store is a dets file, which

Re: loading erlang terms

2010-10-26 Thread Charles Blair
On Tue, Oct 26, 2010 at 09:13:17AM -0700, Seth Falcon wrote: > Perhaps I'm missing something... How about using Erlang's native > binary term serialization. > > B = term_to_binary(Terms), > % now store B in Riak > > % ... > > % now get B out and do: > binary_to_term(B) Thanks, Seth. That's a fi

Re: loading erlang terms

2010-10-26 Thread Charles Blair
Btw, the documentation has this: encode_term(Object, Term) -> riakc_obj:update_value(Object, term_to_binary(Term, [compressed]), <<"application/x-erlang-term">>). This gave me the idea that perhaps by encoding the content type as application/x-erlang-term I could g

erlang client: dropping connections

2010-10-26 Thread Charles Blair
I have successfully connected an erlang client to a running riak server and gotten some work done, but if the server returns an error response, the connection is dropped. A typical error might result in a message such as ** exception error: no function clause matching [whatever] Grovelling thro

Re: loading erlang terms

2010-10-27 Thread Charles Blair
chas">>). {ok,{riakc_obj,<<"people">>,<<"chas">>, <<107,206,97,96,96,96,204,96,202,5,82,44,236,70,107,239, 100,48,37,50,230,177,50,...>>, [{{dict,3,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],...},

Re: loading erlang terms

2010-10-28 Thread Charles Blair
,224,206,96,202,5,82,44,236,70,107,239, 100,48,37,50,230,177,50,...>>, [{{dict,4,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],...}, {{[],[], [[<<"Links">>, {{<<"images">>,<<"abc">>},<&