annotate docs/ccguide/open.refentry @ 602:42b2c775f05f

All refentries finished.
author roug
date Fri, 15 Nov 2002 21:49:51 +0000
parents e43a77fddcbd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
1 <refentry id="open">
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
2 <refnamediv>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
3 <refname>Open</refname>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
4 <refpurpose>open a file for read/write access</refpurpose>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
5 </refnamediv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
6
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
7 <refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
8 <funcsynopsis>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
9 <funcprototype>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
10 <funcdef><function>open</function></funcdef>
572
e43a77fddcbd All function prototypes are added.
roug
parents: 552
diff changeset
11 <paramdef>char *<parameter>fname</parameter></paramdef>
e43a77fddcbd All function prototypes are added.
roug
parents: 552
diff changeset
12 <paramdef>int <parameter>mode</parameter></paramdef>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
13 </funcprototype>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
14 </funcsynopsis>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
15
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
16 </refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
17
542
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
18 <refsect1><title>Assembler Equivalent</title>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
19 <para>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
20 os9 I$OPEN
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
21 </para>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
22 </refsect1>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
23
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
24 <refsect1><title>Description</title>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
25 <para>
602
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
26 This call opens an existing file for reading if "mode" is 1,
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
27 writing if "mode" is 2, or reading and writing if "mode" is 3.
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
28 NOTE that these values are OS-9 specific and not compatible
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
29 with other systems. "Fname" should point to a string
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
30 representing the pathname of the file.
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
31 </para>
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
32 <para>
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
33 Open returns an integer as "path number" which should be used
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
34 by i/o system calls referring to the file.
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
35 </para>
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
36 <para>
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
37 The position where reads or writes start is at the beginning of
42b2c775f05f All refentries finished.
roug
parents: 572
diff changeset
38 the file.
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
39 </para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
40 </refsect1>
542
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
41
552
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
42 <refsect1><title>Diagnostics</title>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
43 <para>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
44 -1 is returned if the file does not exist, if the pathname
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
45 cannot be searched, if too many files are already open, or if
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
46 the file permissions deny the requested mode.
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
47 </para>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
48 </refsect1>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
49
542
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
50 <refsect1><title>See Also</title>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
51 <para>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
52 <link linkend="creat">creat()</link>,
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
53 <link linkend="read">read()</link>,
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
54 <link linkend="write">write()</link>,
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
55 <link linkend="dup">dup()</link>,
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
56 <link linkend="close">close()</link>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
57 </para>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
58 </refsect1>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
59
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
60 </refentry>