Erlang – is_file

Erlang is_file

In this guide, we will discuss Erlang is_file. This method is used to determine if a file is indeed a file. This method is a part of the filelib library.

Syntax

is_file(filename)

Parameters

  • filename − This is the file name for which it needs to be determined if it is a file or not.

Return Value

True, if the file exists and is indeed a file.

For example

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

start() -> 
   io:fwrite("~p~n",[filelib:is_file("Renamedfile.txt")]).

Output

If the file exists, the output will be true

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply