erl_prim_loader(3erl)
erl_prim_loader(3erl) β low-level Erlang loader π
okay so this is the official Erlang Module Definition page for erl_prim_loader(3erl), and itβs literally the little low-level loader that gets your Erlang world booted. β¨
NAME π
erl_prim_loader β Low-level Erlang loader. Thatβs the name, thatβs the vibe, periodt.
DESCRIPTION πΈ
This module is used to load all Erlang modules into the system. The start script is also fetched with this low-level loader. No cap.
erl_prim_loader knows about the environment and how to fetch modules. Itβs giving βI know where the modules live and Iβm not afraid to use it.β π
Command-line flag -loader Loader can be used to choose the method used by erl_prim_loader. The Erlang runtime system supports two Loader methods: efile and inet. Iconic.
EXPORTS π
get_file(Filename) -> {ok, Bin, FullName} | error
Types:
Filename = atom() | string()
Bin = binary()
FullName = string()
Fetches a file using the low-level loader. Filename is either an absolute filename or only the name of the file, for example, "lists.beam". If an internal path is set to the loader, this path is used to find the file. FullName is the complete name of the fetched file. Bin is the contents of the file as a binary.
Filename can also be a file in an archive, for example, $OTPROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia.beam. For information about archive files, see code(3erl).
get_path() -> {ok, Path}
Types:
Path = [Dir :: string()]
Gets the path set in the loader. The path is set by the init(3erl) process according to information found in the start script.
list_dir(Dir) -> {ok, Filenames} | error
Types:
Dir = string()
Filenames = [Filename :: string()]
Lists all the files in a directory. Returns {ok, Filenames} if successful, otherwise error. Filenames is a list of the names of all the files in the directory. The names are not sorted.
Dir can also be a directory in an archive, for example, $OTPROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin. For information about archive files, see code(3erl).
read_file_info(Filename) -> {ok, FileInfo} | error
Types:
Filename = string()
FileInfo = file:file_info()
Retrieves information about a file. Returns {ok, FileInfo} if successful, otherwise error. FileInfo is a record file_info, defined in the Kernel include file file.hrl. Include the following directive in the module from which the function is called:
-include_lib("kernel/include/file.hrl").
For more information about the record file_info, see file(3erl).
Filename can also be a file in an archive, for example, $OTPROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia. For information about archive files, see code(3erl).
read_link_info(Filename) -> {ok, FileInfo} | error
Types:
Filename = string()
FileInfo = file:file_info()
Works like read_file_info/1 except that if Filename is a symbolic link, information about the link is returned in the file_info record and the type field of the record is set to symlink.
If Filename is not a symbolic link, this function returns exactly the same result as read_file_info/1. On platforms that do not support symbolic links, this function is always equivalent to read_file_info/1.
set_path(Path) -> ok
Types:
Path = [Dir :: string()]
Sets the path of the loader if init(3erl) interprets a path command in the start script.
COMMAND-LINE FLAGS π©
The erl_prim_loader module interprets the following command-line flags:
-loader Loaderβ Specifies the name of the loader used byerl_prim_loader.Loadercan beefile(use the local file system) orinet(load using theboot_serveron another Erlang node). If flag-loaderis omitted, it defaults toefile.-loader_debugβ Makes theefileloader write some debug information, such as the reason for failures, while it handles files.-hosts Hostsβ Specifies which other Erlang nodes theinetloader can use. This flag is mandatory if flag-loader inetis present. On each host, there must be an Erlang node with theerl_boot_server(3erl), which handles the load requests.Hostsis a list of IP addresses (hostnames are not acceptable).-setcookie Cookieβ Specifies the cookie of the Erlang runtime system. This flag is mandatory if flag-loader inetis present.
SEE ALSO π«Ά
init(3erl), erl_boot_server(3erl)
Catch you later, bestie β this was Ericsson ABβs erts 13.2.2.5 moment, officially served as erl_prim_loader(3erl). πβ¨π
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms