English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
此方法用于列出特定目录的内容。
list_dir(directory)
directory −需要列出其内容的目录。
包含目录中文件名的项目列表。
-module(helloworld). -export([start/0]). start() -> io:fwrite("~p~n",[file:list_dir(".")]).
根据当前工作目录的内容,文件列表将相应显示。示例输出显示在以下程序中-
{ok,["helloworld.erl",".cg_conf","Newfile.txt","helloworld.beam"]}