dirty mnesia function

Ulf Wiger <>
Tue Sep 24 09:53:14 CEST 2002


On 23 Sep 2002, Sebastian Strollo wrote:

>I think ~p is actually what is doing the "pretty printing"
>including adding |... when the data is too deep (see
>io_lib:print). If you want to print a term completely use
>~w.

For reasons that I have not had the energy to investigate,
calling io:format("~p~n", [X]) from the shell does _not_
lead to truncated output (at least not for me.)

...after a quick look in the shell.erl source:

The parameter that causes the truncated output is ~P.
Note that it takes two arguments:

  io:format("~P~n", [X,LineMax])

(It's even documented in
http://www.erlang.org/doc/r8b/lib/stdlib-1.10.1.1/doc/html/io.html#fwrite%3)


Eshell V5.0.2.15  (abort with ^G)
1> T = erlang:make_tuple(10,foo).
{foo,foo,foo,foo,foo,foo,foo,foo,foo,foo}
2> L = lists:duplicate(20,T).
[{foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo|...}]
3> io:format("~p~n", [L]).
[{foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo}]
ok
4> io:format("~P~n", [L,30]).
[{foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo,foo},
 {foo,foo,foo,foo,foo,foo,foo,foo,foo|...}]
ok


-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson Telecom AB, ATM Multiservice Networks




More information about the erlang-questions mailing list