[erlang-questions] Reading a big text file from a web server.

rtgreg rtgreg rtgreg@REDACTED
Sat Apr 28 16:17:12 CEST 2007


I'm starting to study erlang from the "Concurrent Programming in
Erlang" book available in the website.

To test my knowledge I've decided to port a small Python application
of mine to Erlang but I'm having problems with memory consumption and

One of the modules has to read a file from a web server in the following format:

Key1 The value for key 1
Key2 The value for key 2
Begin Key3
The value for key 3 is
a lot longer and we
need several lines
End Key3

Right now my, very naive, implementation is reading the result of
http:request("http://example.com/file.txt") and split it by new lines.
The file is several megabytes long so the memory consumption increases

What do you recommend to implement this functionality?


More information about the erlang-questions mailing list