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