此方法用于列出特定目录的内容。
list_dir(directory)
directory - 需要列出其内容的目录。
包含目录中文件名的项目列表。
-module(helloLearnfk). -export([start/0]). start() -> io:fwrite("~p~n",[file:list_dir(".")]).
根据当前工作目录的内容,文件列表将相应显示。
{ok,["helloLearnfk.erl",".cg_conf","Newfile.txt","helloLearnfk.beam"]}
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)