io:columns/1
返回指定输出端的列数
用法:
columns(IoDevice) -> {ok, integer() >= 1} | {error, enotsup}
返回指定输出端 IoDevice 的列数,该函数只在终端下调用才能返回正确的结果值,其他输出端只返回 {error, enotsup}
{ok, IoDevice} = file:open("test.txt", write), Columns = io:columns(IoDevice), io:format("Columns is ~p~n", [Columns]).