The c
module enables users to enter the short form of
some commonly used commands. These functions are are intended
for interactive use in the Erlang shell.
Pid = pid()
This function evaluates
erlang:process_display(Pid, backtrace)
.
This function is equivalent to:
compile:file(File,[report_errors, report_warnings])
c(File, Flags) -> CompileResult
File = atom() | string()
CompileResult = {ok, ModuleName} | error
ModuleName = atom()
Flags = [Flag]
This function calls the following function and then purges and loads the code for the file:
compile:file(File, Flags ++ [report_errors, report_warnings])
If the module corresponding to File
is being
interpreted, then int:i
is called with the
same arguments and the module is loaded into the interpreter.
Note that int:i
only recognizes a subset of the options
recognized by compile:file
.
Extreme care should be exercised when using this command to change running code which is executing. The expected result may not be obtained.
Refer to compiler
manual pages for a description of the individual compiler flags.
Dir = atom() | string()
This function changes the current working directory to Dir
,
and then prints the new working directory.
This function flushes all messages in the shell message queue.
This function displays help about the shell and about the command interface module.
This function provides information about the current state of the
system. This call uses the BIFs processes()
and process_info/1
to
examine the current state of the system. (The code is a good introduction
to these two BIFs).
This function works like i()
, but additionally displays
information about zombie processes, i.e., processes which have
exited, but which are still kept in the system to be inspected.
This function does the same as i()
, but for all nodes in the network.
X = Y = Z = int()
This function evaluates process_info(pid(X, Y, Z))
.
Module = atom(), | string()
This function evaluates code:purge(Module)
followed by
code:load_module(Module)
. It reloads the module.
ListOfFiles = [File]
File = atom() | string()
Result = [CompileResult]
CompileResult = {ok, ModuleName} | error
ModuleName = atom()
This function compiles several files by calling c(File)
for each
file in ListOfFiles
.
This function lists all files in the current directory.
Dir = atom() | string()
This function lists all files in the directory Dir
.
This function lists the modules which have been loaded and the files from which they have been loaded.
Module = atom()
This function lists information about Module
.
File = atom() | string()
This function compiles File
and loads it on all nodes in an Erlang
nodes network.
File = atom() | string()
Flags = [Flag]
This function compiles File
with the additional compiler
flags Flags
and loads it on all nodes in an Erlang nodes
network. Refer to the compile
manual pages for a description of Flags
.
Module = atom()
This function loads Module
on all nodes in an Erlang nodes network.
X = Y = Z = int()
This function converts the integers X
, Y
, and Z
to the
Pid <X.Y.Z>
. It saves typing and the use of
list_to_pid/1
. This function should only be used when debugging.
This function prints the current working directory.
This function is shorthand for init:stop()
, i.e., it
causes the node to stop in a controlled fashion.
This function displays formatted information about all registered processes in the system.
This function is the same as regs()
, but on all nodes in the system.
TupleList = [TwoTuple]
TwoTuple = {atom(), int()}
A list of tuples is returned. Each tuple has two elements. The first element is an atom describing memory type. The second element is memory size in bytes. A description of each tuple follows:
total
total
is
the sum of processes
and system
.
processes
system
atom
system
memory.
atom_used
atom
memory.
binary
system
memory.
code
system
memory.
ets
system
memory.
A process executing this function may be preempted by other processes; therefore, the returned information may not be a consistent snapshot of the memory allocation state.
More tuples in the returned list may be added in the future.
MemoryType = atom()
MemoryType
is one of the following atoms: total
,
processes
, system
, atom
, atom_used
,
binary
, code
or ets
. These atoms correspond
to the atoms described for memory/0
above. An integer
representing the memory in bytes that corresponds to the argument
is returned.
A process executing this function may be preempted by other processes; therefore, the returned information may not be a consistent snapshot of the memory allocation state.
More arguments may be added in the future.
Failure: badarg
if MemoryType
is not one of the atoms
listed above.