English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This method is used to list the contents of a specific directory.
list_dir(directory)
directory −Directory that needs to be listed for its content.
A list of items containing filenames in the directory.
-module(helloworld). -export([start/0]). start() -> io:fwrite("~p~n",[file:list_dir(".")]).
The file list will be displayed accordingly based on the content of the current working directory. Example output is shown in the following program.-
{ok,["helloworld.erl",".cg_conf","Newfile.txt","helloworld.beam"]}