1RFIO_OPEN(3) Rfio Library Functions
2RFIO_OPEN(3)
3
4
5
6[1mNAME[0m
7 rfio_open ‐ opens a file
8
9[1mSYNOPSIS[0m
10 [1m#include <sys/types.h>[0m
11 [1m#include "rfio_api.h"[0m
12
13 [1mint rfio_open (const char *[4m[22mpath[24m[1m, int
14[4m[22mflags[24m[1m, int [4m[22mmode[24m[1m);[0m
15
16 Under Linux, for large files:
17 [1m#define _LARGEFILE64_SOURCE[0m
18 [1m#include <sys/types.h>[0m
19 [1m#include "rfio_api.h"[0m
20
21 [1mint rfio_open64 (const char *[4m[22mpath[24m[1m, int
22[4m[22mflags[24m[1m, int [4m[22mmode[24m[1m);[0m
23
24 For large files, under other systems:
25 [1m#include <sys/types.h>[0m
26 [1m#include "rfio_api.h"[0m
27
28 [1mint rfio_open64 (const char *[4m[22mpath[24m[1m, int
29[4m[22mflags[24m[1m, int [4m[22mmode[24m[1m);[0m
30
31[1mDESCRIPTION[0m
32 [1mrfio_open [22mopens the file whose name is the string
33pointed to by [1mpath[22m, a
34 character string containing the filename specification,
35and associates
36 a FILE stream with it.
37 [1mflags [22mare formed by ORing the following values:
38
39 O_RDONLY Open for reading only
40 O_WRONLY Open for writing only
41 O_RDWR Open for reading and writing
42 O_NDELAY Do not block on open
43 O_APPEND Append on each write
44 O_CREAT Create file if it does not exist
45 O_TRUNC Truncate size to 0
46 O_EXCL Error if create and file exists
47 O_LARGEFILE When size can be superior to
482GB‐1.
49 See NOTES
50
51 [1mmode [22mspecifies the permission bits to be set if the
52file is created.
53
54 Opening a file with O_APPEND set causes each write on
55the file to be
56 appended to the end. If O_TRUNC is specified and the file
57exists, the
58 file is truncated to zero length. If O_EXCL is set with
59O_CREAT, then
60 if the file already exists, the open returns an error.
61This can be
62 used to implement a simple exclusive access locking
63mechanism. If
64 O_EXCL is set and the last component of the pathname is
65a symbolic
66 link, the open will succeed even if the symbolic link
67points to an
68 existing name. If the O_NDELAY flag is specified and
69the open call
70 would result in the process being blocked for some reason
71(for example
72 waiting for a carrier on a dial‐up line), the open returns
73immediately.
74 The first time the process attempts to perform IO on the
75open file, it
76 will block (not currently implemented). On systems that
77support the
78 Large Files, O_LARGEFILE in rfio_open allows files whose
79sizes cannot
80 be represented in 31 bits to be opened.
81
82
83[1mRETURN VALUE[0m
84 If successful, returns a non‐negative integer which may
85be used to
86 refer to the file on subsequent [1mrfio_write[22m,
87[1mrfio_read [22mand [1mrfio_close[0m
88 calls. On failure, [1mrfio_open [22mreturns ‐1 and the
89error code is stored
90 in serrno.
91
92
93[1mERRORS[0m
94 [1mENOENT [22mThe named file/directory does not ex‐
95ist or is a null path‐
96 name.
97
98 [1mEACCES [22mSearch permission is denied on a com‐
99ponent of the [4mpath[0m
100 prefix.
101
102 [1mEBUSY [22mDevice or resource busy. Happens
103if you try to open in
104 write mode a LCG file that is in an ac‐
105tive migration
106 stream.
107
108 [1mEFAULT [4m[22mpath[24m is a NULL pointer.
109
110 [1mENOTDIR [22mA component of [4mpath[24m prefix is
111not a directory.
112
113 [1mENAMETOOLONG [22mThe length of [4mpath[24m exceeds
114[1mCA_MAXPATHLEN [22mor the length of
115 a [4mpath[24m component exceeds [1mCA_MAX‐
116NAMELEN[22m.
117
118 [1mSENOSHOST [22mHost unknown.
119
120 [1mSENOSSERV [22mService unknown.
121
122 [1mSECOMERR [22mCommunication error.
123
124[1mSEE ALSO[0m
125 [1mCastor_limits(4)[22m,[1mrfio_write(3)[22m,[1mr‐
126fio_read(3)[22m,[1mrfio_close(3)[0m
127
128[1mNOTES[0m
129 On Irix, Tru64 and IA64 the 64 bit mode is the default
130one, open and
131 open64 are identical. The [4mflag[24m O_LARGEFILE is ac‐
132cepted on Irix and IA64
133 (where it has no effect) but not on Tru64. On all oth‐
134er platforms,
135 rfio_open with O_LARGEFILE is equivalent to a call to
136rfio_open64.
137
138[1mAUTHOR[0m
139 [1mLCG Grid Deployment [22mTeam
140
141
142
143
144LCG $Date: 2005/03/31 13:13:03 $
145RFIO_OPEN(3)
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