~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/stdlib/doc/src/io.xml

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
<erlref>
5
5
  <header>
6
6
    <copyright>
7
 
      <year>1996</year><year>2009</year>
 
7
      <year>1996</year><year>2011</year>
8
8
      <holder>Ericsson AB. All Rights Reserved.</holder>
9
9
    </copyright>
10
10
    <legalnotice>
13
13
      compliance with the License. You should have received a copy of the
14
14
      Erlang Public License along with this software. If not, it can be
15
15
      retrieved online at http://www.erlang.org/.
16
 
    
 
16
 
17
17
      Software distributed under the License is distributed on an "AS IS"
18
18
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
19
19
      the License for the specific language governing rights and limitations
20
20
      under the License.
21
 
    
 
21
 
22
22
    </legalnotice>
23
23
 
24
24
    <title>io</title>
81
81
  </section>
82
82
  <funcs>
83
83
    <func>
84
 
      <name>columns([IoDevice]) -> {ok,int()} | {error, enotsup}</name>
 
84
      <name>columns() -> {ok,int()} | {error, enotsup}</name>
 
85
      <name>columns(IoDevice) -> {ok,int()} | {error, enotsup}</name>
85
86
      <fsummary>Get the number of columns of a device</fsummary>
86
87
      <type>
87
88
        <v>IoDevice = io_device()</v>
94
95
      </desc>
95
96
    </func>
96
97
    <func>
97
 
      <name>put_chars([IoDevice,] IoData) -> ok</name>
 
98
      <name>put_chars(IoData) -> ok</name>
 
99
      <name>put_chars(IoDevice, IoData) -> ok</name>
98
100
      <fsummary>Write a list of characters</fsummary>
99
101
      <type>
100
102
        <v>IoDevice = io_device()</v>
106
108
      </desc>
107
109
    </func>
108
110
    <func>
109
 
      <name>nl([IoDevice]) -> ok</name>
 
111
      <name>nl() -> ok</name>
 
112
      <name>nl(IoDevice) -> ok</name>
110
113
      <fsummary>Write a newline</fsummary>
111
114
      <type>
112
115
        <v>IoDevice = io_device()</v>
116
119
      </desc>
117
120
    </func>
118
121
    <func>
119
 
      <name>get_chars([IoDevice,] Prompt, Count) -> Data | eof</name>
 
122
      <name>get_chars(Prompt, Count) -> Data | eof</name>
 
123
      <name>get_chars(IoDevice, Prompt, Count) -> Data | eof</name>
120
124
      <fsummary>Read a specified number of characters</fsummary>
121
125
      <type>
122
126
        <v>IoDevice = io_device()</v>
150
154
      </desc>
151
155
    </func>
152
156
    <func>
153
 
      <name>get_line([IoDevice,] Prompt) -> Data | eof | {error,Reason}</name>
 
157
      <name>get_line(Prompt) -> Data | eof | {error,Reason}</name>
 
158
      <name>get_line(IoDevice, Prompt) -> Data | eof | {error,Reason}</name>
154
159
      <fsummary>Read a line</fsummary>
155
160
      <type>
156
161
        <v>IoDevice = io_device()</v>
183
188
      </desc>
184
189
    </func>
185
190
    <func>
186
 
      <name>getopts([IoDevice]) -> Opts</name>
 
191
      <name>getopts() -> Opts</name>
 
192
      <name>getopts(IoDevice) -> Opts</name>
187
193
      <fsummary>Get the supported options and values from an I/O-server</fsummary>
188
194
      <type>
189
195
        <v>IoDevice = io_device()</v>
210
216
      </desc>
211
217
    </func>
212
218
    <func>
213
 
      <name>setopts([IoDevice,] Opts) -> ok | {error, Reason}</name>
 
219
      <name>setopts(Opts) -> ok | {error, Reason}</name>
 
220
      <name>setopts(IoDevice, Opts) -> ok | {error, Reason}</name>
214
221
      <fsummary>Set options</fsummary>
215
222
      <type>
216
223
        <v>IoDevice = io_device()</v>
281
288
      </desc>
282
289
    </func>
283
290
    <func>
284
 
      <name>write([IoDevice,] Term) -> ok</name>
 
291
      <name>write(Term) -> ok</name>
 
292
      <name>write(IoDevice, Term) -> ok</name>
285
293
      <fsummary>Write a term</fsummary>
286
294
      <type>
287
295
        <v>IoDevice = io_device()</v>
293
301
      </desc>
294
302
    </func>
295
303
    <func>
296
 
      <name>read([IoDevice,] Prompt) -> Result</name>
 
304
      <name>read(Prompt) -> Result</name>
 
305
      <name>read(IoDevice, Prompt) -> Result</name>
297
306
      <fsummary>Read a term</fsummary>
298
307
      <type>
299
308
        <v>IoDevice = io_device()</v>
356
365
    </func>
357
366
    <func>
358
367
      <name>fwrite(Format) -></name>
359
 
      <name>fwrite([IoDevice,] Format, Data) -> ok</name>
 
368
      <name>fwrite(Format, Data) -> ok</name>
 
369
      <name>fwrite(IoDevice, Format, Data) -> ok</name>
360
370
      <name>format(Format) -></name>
361
 
      <name>format([IoDevice,] Format, Data) -> ok</name>
 
371
      <name>format(Format, Data) -> ok</name>
 
372
      <name>format(IoDevice, Format, Data) -> ok</name>
362
373
      <fsummary>Write formatted output</fsummary>
363
374
      <type>
364
375
        <v>IoDevice = io_device()</v>
464
475
            <p>Prints the argument with the <c>string</c> syntax. The
465
476
              argument is, if no Unicode translation modifier is present, an 
466
477
              <seealso marker="erts:erlang#iolist_definition">I/O list</seealso>, a binary, or an atom. If the Unicode translation modifier ('t') is in effect, the argument is chardata(), meaning that binaries are in UTF-8. The characters
467
 
              are printed without quotes. In this format, the printed
468
 
              argument is truncated to the given precision and field
469
 
              width.</p>
 
478
              are printed without quotes. The string is first truncated
 
479
              by the given precision and then padded and justified
 
480
              to the given field width. The default precision is the field width.</p>
470
481
            <p>This format can be used for printing any object and
471
482
              truncating the output so it fits a specified field:</p>
472
483
            <pre>
475
486
ok
476
487
4> <input>io:fwrite("|~10s|~n", [io_lib:write({hey, hey, hey})]).</input>
477
488
|{hey,hey,h|
 
489
5> <input>io:fwrite("|~-10.8s|~n", [io_lib:write({hey, hey, hey})]).</input>
 
490
|{hey,hey  |
478
491
ok</pre>
479
492
          <p>A list with integers larger than 255 is considered an error if the Unicode translation modifier is not given:</p>
480
493
<pre>
660
673
      </desc>
661
674
    </func>
662
675
    <func>
663
 
      <name>fread([IoDevice,] Prompt, Format) -> Result</name>
 
676
      <name>fread(Prompt, Format) -> Result</name>
 
677
      <name>fread(IoDevice, Prompt, Format) -> Result</name>
664
678
      <fsummary>Read formatted input</fsummary>
665
679
      <type>
666
680
        <v>IoDevice = io_device()</v>
820
834
      </desc>
821
835
    </func>
822
836
    <func>
823
 
      <name>rows([IoDevice]) -> {ok,int()} | {error, enotsup}</name>
 
837
      <name>rows() -> {ok,int()} | {error, enotsup}</name>
 
838
      <name>rows(IoDevice) -> {ok,int()} | {error, enotsup}</name>
824
839
      <fsummary>Get the number of rows of a device</fsummary>
825
840
      <type>
826
841
        <v>IoDevice = io_device()</v>
834
849
    </func>
835
850
    <func>
836
851
      <name>scan_erl_exprs(Prompt) -></name>
837
 
      <name>scan_erl_exprs([IoDevice,] Prompt, StartLine) -> Result</name>
 
852
      <name>scan_erl_exprs(Prompt, StartLine) -> Result</name>
 
853
      <name>scan_erl_exprs(IoDevice, Prompt, StartLine) -> Result</name>
838
854
      <fsummary>Read and tokenize Erlang expressions</fsummary>
839
855
      <type>
840
856
        <v>IoDevice = io_device()</v>
877
893
    </func>
878
894
    <func>
879
895
      <name>scan_erl_form(Prompt) -></name>
880
 
      <name>scan_erl_form([IoDevice,] Prompt, StartLine) -> Result</name>
 
896
      <name>scan_erl_form(Prompt, StartLine) -> Result</name>
 
897
      <name>scan_erl_form(IoDevice, Prompt, StartLine) -> Result</name>
881
898
      <fsummary>Read and tokenize an Erlang form</fsummary>
882
899
      <type>
883
900
        <v>IoDevice = io_device()</v>
900
917
    </func>
901
918
    <func>
902
919
      <name>parse_erl_exprs(Prompt) -></name>
903
 
      <name>parse_erl_exprs([IoDevice,] Prompt, StartLine) -> Result</name>
 
920
      <name>parse_erl_exprs(Prompt, StartLine) -> Result</name>
 
921
      <name>parse_erl_exprs(IoDevice, Prompt, StartLine) -> Result</name>
904
922
      <fsummary>Read, tokenize and parse Erlang expressions</fsummary>
905
923
      <type>
906
924
        <v>IoDevice = io_device()</v>
943
961
    </func>
944
962
    <func>
945
963
      <name>parse_erl_form(Prompt) -></name>
946
 
      <name>parse_erl_form([IoDevice,] Prompt, StartLine) -> Result</name>
 
964
      <name>parse_erl_form(Prompt, StartLine) -> Result</name>
 
965
      <name>parse_erl_form(IoDevice, Prompt, StartLine) -> Result</name>
947
966
      <fsummary>Read, tokenize and parse an Erlang form</fsummary>
948
967
      <type>
949
968
        <v>IoDevice = io_device()</v>
1003
1022
    <title>Standard Error</title>
1004
1023
    <p>In certain situations, especially when the standard output is redirected, access to an io_server() specific for error messages might be convenient. The io_device 'standard_error' can be used to direct output to whatever the current operating system considers a suitable device for error output. Example on a Unix-like operating system:</p>
1005
1024
<pre>
1006
 
$ <input>erl -noshell -noinput -eval 'io:format(standard_error,"Error: ~s~n",["error 11"]),init:stop().' > /dev/null</input>
 
1025
$ <input>erl -noshell -noinput -eval 'io:format(standard_error,"Error: ~s~n",["error 11"]),'\</input>
 
1026
<input>'init:stop().' > /dev/null</input>
1007
1027
Error: error 11</pre>
1008
1028
 
1009
1029
 
1020
1040
    <p>A string which describes the error is obtained with the following
1021
1041
      call:</p>
1022
1042
    <code type="none">
1023
 
apply(Module, format_error, ErrorDescriptor)</code>
 
1043
Module:format_error(ErrorDescriptor)</code>
1024
1044
  </section>
1025
1045
</erlref>
1026
1046