This method is used to list down the contents of a particular directory.
directory − The directory for which the contents need to be listed.
The list of items which contains the file names in the directory.
-module(helloworld). -export([start/0]). start() -> io:fwrite("~p~n",[file:list_dir(".")]).
Depending on the contents of your current working directory, the list of files will be displayed accordingly. An example output is shown in the following program −