466
|
1 <refentry id="write">
|
|
2 <refnamediv>
|
468
|
3 <refname>Write</refname>
|
|
4 <refname>Writeln</refname>
|
|
5 <refpurpose>write to a file or device</refpurpose>
|
466
|
6 </refnamediv>
|
|
7
|
|
8 <refsynopsisdiv>
|
|
9 <funcsynopsis>
|
|
10 <funcprototype>
|
|
11 <funcdef><function>write</function></funcdef>
|
580
|
12 <paramdef>int <parameter>pn</parameter></paramdef>
|
|
13 <paramdef>char *<parameter>buffer</parameter></paramdef>
|
|
14 <paramdef>int <parameter>count</parameter></paramdef>
|
|
15 </funcprototype>
|
|
16 <funcprototype>
|
|
17 <funcdef><function>writeln</function></funcdef>
|
|
18 <paramdef>int <parameter>pn</parameter></paramdef>
|
|
19 <paramdef>char *<parameter>buffer</parameter></paramdef>
|
|
20 <paramdef>int <parameter>count</parameter></paramdef>
|
466
|
21 </funcprototype>
|
|
22 </funcsynopsis>
|
|
23
|
|
24 </refsynopsisdiv>
|
|
25
|
548
|
26 <refsect1><title>Assembler Equivalent</title>
|
|
27 <para>
|
|
28 os9 I$WRITE
|
|
29 </para>
|
|
30 <para>
|
|
31 os9 I$WRITLN
|
|
32 </para>
|
|
33 </refsect1>
|
|
34
|
466
|
35 <refsect1><title>Description</title>
|
|
36 <para>
|
608
|
37 "Pn" must be a value returned by "open", "creat" or "dup" or
|
|
38 should be a 0(stdin), 1(stdout), or 2(stderr).
|
|
39 </para>
|
|
40 <para>
|
|
41 "Buffer should point to an area of memory from which "count"
|
|
42 bytes are to be written. Write returns the actual number of
|
|
43 bytes written, and if this is different from "count", an
|
|
44 error has occurred.
|
|
45 </para>
|
|
46 <para>
|
|
47 Writes in multiples of 256 bytes to file offset boundaries of
|
|
48 256 bytes are the most efficient.
|
|
49 </para>
|
|
50 <para>
|
|
51 Write causes no "line-editing" to occur on output. Writeln
|
|
52 causes line-editing and only writes up to the first "\n" in the
|
|
53 buffer if this is found before "count" is exhausted. For a
|
|
54 full description of the actions of these calls the reader is
|
|
55 referred to the OS-9 documentation.
|
466
|
56 </para>
|
|
57 </refsect1>
|
548
|
58
|
552
|
59 <refsect1><title>Diagnostics</title>
|
|
60 <para>
|
|
61 -1 is returned if "pn" is a bad path number, of "count" is
|
|
62 ridiculous or on physical i/o error.
|
|
63 </para>
|
|
64 </refsect1>
|
|
65
|
548
|
66 <refsect1><title>See Also</title>
|
|
67 <para>
|
|
68 <link linkend="creat">creat()</link>,
|
|
69 <link linkend="open">open()</link>
|
|
70 </para>
|
|
71 </refsect1>
|
|
72
|
466
|
73 </refentry>
|