Erlang - make_dir


Advertisements


This method is used to create a new directory.

Syntax

make_dir(directory)

Parameters

  • directory − This is the name of the directory which needs to be created.

Return Value

A status on the directory creation operation. If this is successful, an {Ok} message will be displayed.

For example

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[file:make_dir("newdir")]).

Output

The directory called newdir will be created.


erlang_file_input_output.htm

Advertisements