> Erlang中文手册 > write/2 打印输出一个 Erlang 项元

io:write/2

打印输出一个 Erlang 项元

用法:

write(IoDevice, Term) -> ok

向指定输出端 IoDevice 打印输出一个 Erlang 项元 Term

{ok, IoDevice} = file:open("test.txt", [write]),
io:write(IoDevice, 'Just a test!'),
file:close(IoDevice).