English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang file file_size method

Erlang Files

This method is used to determine the size of the file. This method isfilelibPart of the library.

Syntax

file_size(filename)

Parameter

  • filename −This is the filename that needs to be determined in size.

Return Value

A number representing the file size.

-module(helloworld). 
-export([start/0]). 
start() -> 
   io:fwrite("~w~n",[filelib:file_size("Renamed file.txt")]).

The file size will be displayed based on the content of the file. If the file contains the text 'Example', the output will be7.

Erlang Files