.TH erl_prim_loader 3erl "erts 8.2.1" "Ericsson AB" "Erlang Module Definition" .SH NAME erl_prim_loader \- Low-level Erlang loader. .SH DESCRIPTION .LP This module is used to load all Erlang modules into the system\&. The start script is also fetched with this low-level loader\&. .LP \fIerl_prim_loader\fR\& knows about the environment and how to fetch modules\&. .LP Command-line flag \fI-loader Loader\fR\& can be used to choose the method used by \fIerl_prim_loader\fR\&\&. Two \fILoader\fR\& methods are supported by the Erlang runtime system: \fIefile\fR\& and \fIinet\fR\&\&. .SH EXPORTS .LP .nf .B get_file(Filename) -> {ok, Bin, FullName} | error .br .fi .br .RS .LP Types: .RS 3 Filename = atom() | string() .br Bin = binary() .br FullName = string() .br .RE .RE .RS .LP Fetches a file using the low-level loader\&. \fIFilename\fR\& is either an absolute filename or only the name of the file, for example, \fI"lists\&.beam"\fR\&\&. If an internal path is set to the loader, this path is used to find the file\&. \fIFullName\fR\& is the complete name of the fetched file\&. \fIBin\fR\& is the contents of the file as a binary\&. .LP \fIFilename\fR\& can also be a file in an archive, for example, \fI$OTPROOT/lib/\fR\&\fImnesia-4\&.4\&.7\&.ez/mnesia-4\&.4\&.7/ebin/\fR\&\fImnesia\&.beam\fR\&\&. For information about archive files, see \fB\fIcode(3erl)\fR\&\fR\&\&. .RE .LP .nf .B get_path() -> {ok, Path} .br .fi .br .RS .LP Types: .RS 3 Path = [Dir :: string()] .br .RE .RE .RS .LP Gets the path set in the loader\&. The path is set by the \fB\fIinit(3erl)\fR\&\fR\& process according to information found in the start script\&. .RE .LP .nf .B list_dir(Dir) -> {ok, Filenames} | error .br .fi .br .RS .LP Types: .RS 3 Dir = string() .br Filenames = [Filename :: string()] .br .RE .RE .RS .LP Lists all the files in a directory\&. Returns \fI{ok, Filenames}\fR\& if successful, otherwise \fIerror\fR\&\&. \fIFilenames\fR\& is a list of the names of all the files in the directory\&. The names are not sorted\&. .LP \fIDir\fR\& can also be a directory in an archive, for example, \fI$OTPROOT/lib/\fR\&\fImnesia-4\&.4\&.7\&.ez/mnesia-4\&.4\&.7/ebin\fR\&\&. For information about archive files, see \fB\fIcode(3erl)\fR\&\fR\&\&. .RE .LP .nf .B read_file_info(Filename) -> {ok, FileInfo} | error .br .fi .br .RS .LP Types: .RS 3 Filename = string() .br FileInfo = \fBfile:file_info()\fR\& .br .RE .RE .RS .LP Retrieves information about a file\&. Returns \fI{ok, FileInfo}\fR\& if successful, otherwise \fIerror\fR\&\&. \fIFileInfo\fR\& is a record \fIfile_info\fR\&, defined in the Kernel include file \fIfile\&.hrl\fR\&\&. Include the following directive in the module from which the function is called: .LP .nf -include_lib("kernel/include/file.hrl"). .fi .LP For more information about the record \fIfile_info\fR\&, see \fB\fIfile(3erl)\fR\&\fR\&\&. .LP \fIFilename\fR\& can also be a file in an archive, for example, \fI$OTPROOT/lib/\fR\&\fImnesia-4\&.4\&.7\&.ez/mnesia-4\&.4\&.7/ebin/\fR\&\fImnesia\fR\&\&. For information about archive files, see \fB\fIcode(3erl)\fR\&\fR\&\&. .RE .LP .nf .B read_link_info(Filename) -> {ok, FileInfo} | error .br .fi .br .RS .LP Types: .RS 3 Filename = string() .br FileInfo = \fBfile:file_info()\fR\& .br .RE .RE .RS .LP Works like \fB\fIread_file_info/1\fR\&\fR\& except that if \fIFilename\fR\& is a symbolic link, information about the link is returned in the \fIfile_info\fR\& record and the \fItype\fR\& field of the record is set to \fIsymlink\fR\&\&. .LP If \fIFilename\fR\& is not a symbolic link, this function returns exactly the same result as \fIread_file_info/1\fR\&\&. On platforms that do not support symbolic links, this function is always equivalent to \fIread_file_info/1\fR\&\&. .RE .LP .nf .B set_path(Path) -> ok .br .fi .br .RS .LP Types: .RS 3 Path = [Dir :: string()] .br .RE .RE .RS .LP Sets the path of the loader if \fB\fIinit(3erl)\fR\&\fR\& interprets a \fIpath\fR\& command in the start script\&. .RE .SH "COMMAND-LINE FLAGS" .LP The \fIerl_prim_loader\fR\& module interprets the following command-line flags: .RS 2 .TP 2 .B \fI-loader Loader\fR\&: Specifies the name of the loader used by \fIerl_prim_loader\fR\&\&. \fILoader\fR\& can be \fIefile\fR\& (use the local file system) or \fIinet\fR\& (load using the \fIboot_server\fR\& on another Erlang node)\&. .RS 2 .LP If flag \fI-loader\fR\& is omitted, it defaults to \fIefile\fR\&\&. .RE .TP 2 .B \fI-loader_debug\fR\&: Makes the \fIefile\fR\& loader write some debug information, such as the reason for failures, while it handles files\&. .TP 2 .B \fI-hosts Hosts\fR\&: Specifies which other Erlang nodes the \fIinet\fR\& loader can use\&. This flag is mandatory if flag \fI-loader inet\fR\& is present\&. On each host, there must be on Erlang node with the \fB\fIerl_boot_server(3erl)\fR\&\fR\&, which handles the load requests\&. \fIHosts\fR\& is a list of IP addresses (hostnames are not acceptable)\&. .TP 2 .B \fI-setcookie Cookie\fR\&: Specifies the cookie of the Erlang runtime system\&. This flag is mandatory if flag \fI-loader inet\fR\& is present\&. .RE .SH "SEE ALSO" .LP \fB\fIinit(3erl)\fR\&\fR\&, \fB\fIerl_boot_server(3erl)\fR\&\fR\&