How to Include a file in Erlang?

Total Post:107

Points:535

 941  View(s)
Ratings:
Rate this:
  1. How to Include a file in Erlang?

    To include a file using preprocessors:
    -include(FileName).
    -include_lib(FileName).
    FileName, is a string which is pointing to a file. and the contents will be included according to the position of the directive. The FileName is recommended to use the file name which has .hrl extension for including files.
    For Example:
    -include("sample_file.hrl").
    -include("my_records.hrl").
    -include_lib("kernel/included_files/my_file.hrl").

Answer