records in text files or configuration

Fredrik Thulin <>
Thu Aug 5 01:14:22 CEST 2004


Hi

Is there a way to define a record in my application and then use that 
record in my 'erl -config' file or in a plain text file that I read 
using file:consult() or something similar? Something like this :

-module(test).
-record(db, {key, value}).

read_file(File) ->
    Db = file:consult(File),
    io:format("Result :~n~p~n", [Db]).

and then have a File containing

[#db{key=one, value=foo},
 #db{key=two, value=bar}.

Thanks in advance

/Fredrik



More information about the erlang-questions mailing list