1erl_prim_loader(3) Erlang Module Definition erl_prim_loader(3)
2
3
4
6 erl_prim_loader - Low-level Erlang loader.
7
9 This module is used to load all Erlang modules into the system. The
10 start script is also fetched with this low-level loader.
11
12 erl_prim_loader knows about the environment and how to fetch modules.
13
14 Command-line flag -loader Loader can be used to choose the method used
15 by erl_prim_loader. Two Loader methods are supported by the Erlang run‐
16 time system: efile and inet.
17
19 get_file(Filename) -> {ok, Bin, FullName} | error
20
21 Types:
22
23 Filename = atom() | string()
24 Bin = binary()
25 FullName = string()
26
27 Fetches a file using the low-level loader. Filename is either an
28 absolute filename or only the name of the file, for example,
29 "lists.beam". If an internal path is set to the loader, this
30 path is used to find the file. FullName is the complete name of
31 the fetched file. Bin is the contents of the file as a binary.
32
33 Filename can also be a file in an archive, for example, $OTP‐
34 ROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia.beam. For in‐
35 formation about archive files, see code(3).
36
37 get_path() -> {ok, Path}
38
39 Types:
40
41 Path = [Dir :: string()]
42
43 Gets the path set in the loader. The path is set by the init(3)
44 process according to information found in the start script.
45
46 list_dir(Dir) -> {ok, Filenames} | error
47
48 Types:
49
50 Dir = string()
51 Filenames = [Filename :: string()]
52
53 Lists all the files in a directory. Returns {ok, Filenames} if
54 successful, otherwise error. Filenames is a list of the names of
55 all the files in the directory. The names are not sorted.
56
57 Dir can also be a directory in an archive, for example, $OTP‐
58 ROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin. For information
59 about archive files, see code(3).
60
61 read_file_info(Filename) -> {ok, FileInfo} | error
62
63 Types:
64
65 Filename = string()
66 FileInfo = file:file_info()
67
68 Retrieves information about a file. Returns {ok, FileInfo} if
69 successful, otherwise error. FileInfo is a record file_info, de‐
70 fined in the Kernel include file file.hrl. Include the following
71 directive in the module from which the function is called:
72
73 -include_lib("kernel/include/file.hrl").
74
75 For more information about the record file_info, see file(3).
76
77 Filename can also be a file in an archive, for example, $OTP‐
78 ROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia. For informa‐
79 tion about archive files, see code(3).
80
81 read_link_info(Filename) -> {ok, FileInfo} | error
82
83 Types:
84
85 Filename = string()
86 FileInfo = file:file_info()
87
88 Works like read_file_info/1 except that if Filename is a sym‐
89 bolic link, information about the link is returned in the
90 file_info record and the type field of the record is set to sym‐
91 link.
92
93 If Filename is not a symbolic link, this function returns ex‐
94 actly the same result as read_file_info/1. On platforms that do
95 not support symbolic links, this function is always equivalent
96 to read_file_info/1.
97
98 set_path(Path) -> ok
99
100 Types:
101
102 Path = [Dir :: string()]
103
104 Sets the path of the loader if init(3) interprets a path command
105 in the start script.
106
108 The erl_prim_loader module interprets the following command-line flags:
109
110 -loader Loader:
111 Specifies the name of the loader used by erl_prim_loader. Loader
112 can be efile (use the local file system) or inet (load using the
113 boot_server on another Erlang node).
114
115 If flag -loader is omitted, it defaults to efile.
116
117 -loader_debug:
118 Makes the efile loader write some debug information, such as the
119 reason for failures, while it handles files.
120
121 -hosts Hosts:
122 Specifies which other Erlang nodes the inet loader can use. This
123 flag is mandatory if flag -loader inet is present. On each host,
124 there must be on Erlang node with the erl_boot_server(3), which
125 handles the load requests. Hosts is a list of IP addresses (host‐
126 names are not acceptable).
127
128 -setcookie Cookie:
129 Specifies the cookie of the Erlang runtime system. This flag is
130 mandatory if flag -loader inet is present.
131
133 init(3), erl_boot_server(3)
134
135
136
137Ericsson AB erts 11.2.2.2 erl_prim_loader(3)