File: c.html

package info (click to toggle)
erlang-doc-html 1%3A10.b.1a-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 22,488 kB
  • ctags: 9,933
  • sloc: erlang: 505; ansic: 323; perl: 61; sh: 45; makefile: 39
file content (431 lines) | stat: -rw-r--r-- 10,440 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.2 -->
<HTML>
<HEAD>
  <TITLE>c</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
  <STYLE TYPE="text/css">
<!--
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
  <IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>c</H1>
</CENTER>

<H3>MODULE</H3>
<DIV CLASS=REFBODY>
c
</DIV>

<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
Command Interface Module
</DIV>

<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>

<P>The <CODE>c</CODE> 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.
</DIV>

<H3>EXPORTS</H3>

<P><A NAME="bt/1"><STRONG><CODE>bt(Pid) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Pid = pid()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function evaluates
        <CODE>erlang:process_display(Pid, backtrace)</CODE>.

</DIV>

<P><A NAME="c/1"><STRONG><CODE>c(File) -&#62; CompileResult</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function is equivalent to:
        
<P><CODE>compile:file(File,[report_errors, report_warnings])</CODE>

</DIV>

<P><A NAME="c/2"><STRONG><CODE>c(File, Flags) -&#62; CompileResult</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>File = atom() | string()</CODE></STRONG><BR>
<STRONG><CODE>CompileResult = {ok, ModuleName} | error</CODE></STRONG><BR>
<STRONG><CODE>ModuleName = atom()</CODE></STRONG><BR>
<STRONG><CODE>Flags = [Flag]</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function calls the following function and then purges and loads the code for the file:
        
<P><CODE>compile:file(File, Flags ++ [report_errors, report_warnings])</CODE>
        
<P>If the module corresponding to <CODE>File</CODE> is being
        interpreted, then <CODE>int:i</CODE> is called with the
        same arguments and the module is loaded into the interpreter. 
        Note that <CODE>int:i</CODE> only recognizes a subset of the options
        recognized by <CODE>compile:file</CODE>.

        
<P>Extreme care should be exercised when using this command
to change running code which is executing. The expected result may not be obtained.


        
<P>Refer to <CODE>compiler</CODE> manual pages for a description of the individual compiler flags.

</DIV>

<P><A NAME="cd/1"><STRONG><CODE>cd(Dir) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Dir = atom() | string()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function changes the current working directory to <CODE>Dir</CODE>,
        and then prints the new working directory.

</DIV>

<P><A NAME="flush/0"><STRONG><CODE>flush() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function flushes all messages in the shell message queue.

</DIV>

<P><A NAME="help/0"><STRONG><CODE>help() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function displays help about the shell and about the command
        interface module. 

</DIV>

<P><A NAME="i/0"><STRONG><CODE>i() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function provides information about the current state of the
system. This call uses the BIFs <CODE>processes()</CODE> and <CODE>process_info/1</CODE> to
examine the current state of the system. (The code is a good introduction 
to these two BIFs).

</DIV>

<P><A NAME="i/3"><STRONG><CODE>i(X, Y, Z) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>X = Y = Z = int()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function evaluates <CODE>process_info(pid(X, Y, Z))</CODE>.

</DIV>

<P><A NAME="l/1"><STRONG><CODE>l(Module) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Module = atom() | string()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function evaluates <CODE>code:purge(Module)</CODE> followed by
<CODE>code:load_module(Module)</CODE>. It reloads the module.

</DIV>

<P><A NAME="lc/1"><STRONG><CODE>lc(ListOfFiles) -&#62; Result</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>ListOfFiles = [File]</CODE></STRONG><BR>
<STRONG><CODE>File = atom() | string()</CODE></STRONG><BR>
<STRONG><CODE>Result = [CompileResult]</CODE></STRONG><BR>
<STRONG><CODE>CompileResult = {ok, ModuleName} | error</CODE></STRONG><BR>
<STRONG><CODE>ModuleName = atom()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function compiles several files by calling <CODE>c(File)</CODE> for each
        file in <CODE>ListOfFiles</CODE>. 

</DIV>

<P><A NAME="ls/0"><STRONG><CODE>ls() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function lists all files in the current directory.
</DIV>

<P><A NAME="ls/1"><STRONG><CODE>ls(Dir) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Dir = atom() | string()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function lists all files in the directory <CODE>Dir</CODE>.
</DIV>

<P><A NAME="m/0"><STRONG><CODE>m() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function lists the modules which have been loaded and the files from
        which they have been loaded.

</DIV>

<P><A NAME="m/1"><STRONG><CODE>m(Module) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Module = atom()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function lists information about <CODE>Module</CODE>. 

</DIV>

<P><A NAME="memory/0"><STRONG><CODE>memory() -&#62; MemoryInformation</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P> The same as <CODE>erlang:memory/0</CODE>, see the <CODE>erlang(3)</CODE> man page.

</DIV>

<P><A NAME="memory/1"><STRONG><CODE>memory(MemoryTypeSpecification) -&#62; MemoryInformation</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P> The same as <CODE>erlang:memory/1</CODE>, see the <CODE>erlang(3)</CODE> man page.

</DIV>

<P><A NAME="nc/1"><STRONG><CODE>nc(File) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>File = atom() | string()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function compiles <CODE>File</CODE> and loads it on all nodes in an Erlang
        nodes network. 

</DIV>

<P><A NAME="nc/2"><STRONG><CODE>nc(File, Flags) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>File = atom() | string()</CODE></STRONG><BR>
<STRONG><CODE>Flags = [Flag]</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function compiles <CODE>File</CODE> with the additional compiler
flags <CODE>Flags</CODE> and loads it on all nodes in an Erlang nodes
network. Refer to the <CODE>compile</CODE> manual pages for a description of <CODE>Flags</CODE>.

</DIV>

<P><A NAME="ni/0"><STRONG><CODE>ni() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function does the same as <CODE>i()</CODE>, but for all nodes in the network.

</DIV>

<P><A NAME="nl/1"><STRONG><CODE>nl(Module) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Module = atom()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function loads <CODE>Module</CODE> on all nodes in an Erlang nodes network.

</DIV>

<P><A NAME="nregs/0"><STRONG><CODE>nregs() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function is the same as <CODE>regs()</CODE>, but on all nodes in the system.

</DIV>

<P><A NAME="pid/3"><STRONG><CODE>pid(X, Y, Z) -&#62; pid()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>X = Y = Z = int()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function converts the integers <CODE>X</CODE>, <CODE>Y</CODE>, and <CODE>Z</CODE> to the
Pid <CODE>&#60;X.Y.Z&#62;</CODE>. It saves typing and the use of
<CODE>list_to_pid/1</CODE>. This function should only be used when debugging. 
        
</DIV>

<P><A NAME="pwd/0"><STRONG><CODE>pwd() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function prints the current working directory.

</DIV>

<P><A NAME="q/0"><STRONG><CODE>q() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function is shorthand for <CODE>init:stop()</CODE>, i.e., it
        causes the node to stop in a controlled fashion.

</DIV>

<P><A NAME="regs/0"><STRONG><CODE>regs() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function displays formatted information about all registered processes
        in the system. 

</DIV>

<P><A NAME="xm/1"><STRONG><CODE>xm(ModSpec) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>ModSpec = Module | File</CODE></STRONG><BR>
<STRONG><CODE>Module = atom()</CODE></STRONG><BR>
<STRONG><CODE>File = string()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function finds undefined functions and unused
functions in a module by calling <CODE>xref:m/1</CODE>.

</DIV>

<P><A NAME="zi/0"><STRONG><CODE>zi() -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This function works like <CODE>i()</CODE>, but additionally displays
        information about zombie processes, i.e., processes which have
        exited, but which are still kept in the system to be inspected.

</DIV>

<H3>See Also</H3>
<DIV CLASS=REFBODY>

<P>erlang(3)
</DIV>

<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Joe Armstrong - support@erlang.ericsson.se<BR>
Robert Virding - support@erlang.ericsson.se<BR>
Claes Wikstrm - support@erlang.ericsson.se<BR>

</DIV>
<CENTER>
<HR>
<SMALL>stdlib 1.13.2<BR>
Copyright &copy; 1991-2004
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>