In this guide, we will discuss Erlang file_size. This method is used to determine the size of the file. This method is part of the filelib library.
Syntax
file_size(filename)
Parameters
- filename − This is the file name for which the size needs to be determined.
Return Value
A number which tells the size of the file.
For example
-module(helloworld). -export([start/0]). start() -> io:fwrite("~w~n",[filelib:file_size("Renamed file.txt")]).
Output
Depending on the contents of the file, the size of the file will be displayed. If the file contained the text “Example”, the output would be 7.
Next Topic : Click Here
Pingback: Erlang - rename | Adglob Infosystem Pvt Ltd
Pingback: Erlang - File I/O | Adglob Infosystem Pvt Ltd