blog of Joost Yervante Damad
erlang parse simple config file
In erlang there is a simple way of making config files, just use file:consult/1.
It parses a file that contains erlang terms terminated by a dot.
Given this input file:
{hello, world}.
foo.
42.
It can be used like this:
file:consult("test.txt").
{ok,[{hello,world},foo,42]}
neat eh?
| Print article | This entry was posted by Joost Damad on 07/06/2008 at 17:05, and is filed under lang:en, misc. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |
Comments are closed.