size of an IO list

Hakan Mattsson <>
Wed Mar 2 17:38:28 CET 2005

On Wed, 2 Mar 2005, Joe Armstrong (AL/EAB) wrote:

JA>  How about a BIF to compute the size of an I/O list?
JA>  Why?
JA>  I have made a deep list that I want to output (guess what's it's HTML :-)
JA>  I need to make an HTTP header element  "Content-Length: ..."
JA>  Which is the size of the flattened deep list , but I don't want to flatten it (horrors)
JA>  or traverse it (in Erlang) to find the length.
JA>  Suitable case for a BIF?

What about Bin = list_to_binary(List), size(Bin)?


More information about the erlang-questions mailing list