466
|
1 <refentry id="open">
|
|
2 <refnamediv>
|
468
|
3 <refname>Open</refname>
|
|
4 <refpurpose>open a file for read/write access</refpurpose>
|
466
|
5 </refnamediv>
|
|
6
|
|
7 <refsynopsisdiv>
|
|
8 <funcsynopsis>
|
|
9 <funcprototype>
|
|
10 <funcdef><function>open</function></funcdef>
|
572
|
11 <paramdef>char *<parameter>fname</parameter></paramdef>
|
|
12 <paramdef>int <parameter>mode</parameter></paramdef>
|
466
|
13 </funcprototype>
|
|
14 </funcsynopsis>
|
|
15
|
|
16 </refsynopsisdiv>
|
|
17
|
542
|
18 <refsect1><title>Assembler Equivalent</title>
|
|
19 <para>
|
|
20 os9 I$OPEN
|
|
21 </para>
|
|
22 </refsect1>
|
|
23
|
466
|
24 <refsect1><title>Description</title>
|
|
25 <para>
|
602
|
26 This call opens an existing file for reading if "mode" is 1,
|
|
27 writing if "mode" is 2, or reading and writing if "mode" is 3.
|
|
28 NOTE that these values are OS-9 specific and not compatible
|
|
29 with other systems. "Fname" should point to a string
|
|
30 representing the pathname of the file.
|
|
31 </para>
|
|
32 <para>
|
|
33 Open returns an integer as "path number" which should be used
|
|
34 by i/o system calls referring to the file.
|
|
35 </para>
|
|
36 <para>
|
|
37 The position where reads or writes start is at the beginning of
|
|
38 the file.
|
466
|
39 </para>
|
|
40 </refsect1>
|
542
|
41
|
552
|
42 <refsect1><title>Diagnostics</title>
|
|
43 <para>
|
|
44 -1 is returned if the file does not exist, if the pathname
|
|
45 cannot be searched, if too many files are already open, or if
|
|
46 the file permissions deny the requested mode.
|
|
47 </para>
|
|
48 </refsect1>
|
|
49
|
542
|
50 <refsect1><title>See Also</title>
|
|
51 <para>
|
|
52 <link linkend="creat">creat()</link>,
|
|
53 <link linkend="read">read()</link>,
|
|
54 <link linkend="write">write()</link>,
|
|
55 <link linkend="dup">dup()</link>,
|
|
56 <link linkend="close">close()</link>
|
|
57 </para>
|
|
58 </refsect1>
|
|
59
|
466
|
60 </refentry>
|