1RFIO_STAT(3)                     Rfio      Library      Functions
2RFIO_STAT(3)
3
4
5
6[1mNAME[0m
7       rfio_stat ‐ get information about a file or directory
8
9[1mSYNOPSIS[0m
10       [1m#include <sys/types.h>[0m
11       [1m#include "rfio_api.h"[0m
12
13       [1mint rfio_stat (const char  *[4m[22mpath[24m[1m,  struct
14stat *[4m[22mstatbuf[24m[1m);[0m
15       [1mint   rfio_fstat   (int  [4m[22ms[24m[1m,  struct  stat
16*[4m[22mstatbuf[24m[1m);[0m
17       [1mint rfio_lstat (const char *[4m[22mpath[24m[1m,  struct
18stat *[4m[22mstatbuf[24m[1m);[0m
19       [1mint  rfio_mstat (const char *[4m[22mpath[24m[1m, struct
20stat *[4m[22mstatbuf[24m[1m);[0m
21       [1mint rfio_mstat_reset ();[0m
22       [1mint rfio_end ();[0m
23
24       Under Linux, for large files:
25       [1m#define _LARGEFILE64_SOURCE[0m
26       [1m#include <sys/types.h>[0m
27       [1m#include "rfio_api.h"[0m
28
29       [1mint rfio_stat64 (const char *[4m[22mpath[24m[1m, struct
30stat64 *[4m[22mstatbuf[24m[1m);[0m
31       [1mint  rfio_fstat64  (int  [4m[22ms[24m[1m, struct stat64
32*[4m[22mstatbuf[24m[1m);[0m
33       [1mint  rfio_lstat64  (const   char   *[4m[22mpath[24m[1m,
34struct stat64 *[4m[22mstatbuf[24m[1m);[0m
35       [1mint   rfio_mstat64   (const  char  *[4m[22mpath[24m[1m,
36struct stat64 *[4m[22mstatbuf[24m[1m);[0m
37
38       For large files, under other systems:
39       [1m#include <sys/types.h>[0m
40       [1m#include "rfio_api.h"[0m
41
42       [1mint rfio_stat64 (const char *[4m[22mpath[24m[1m, struct
43stat64 *[4m[22mstatbuf[24m[1m);[0m
44       [1mint  rfio_fstat64  (int  [4m[22ms[24m[1m, struct stat64
45*[4m[22mstatbuf[24m[1m);[0m
46       [1mint  rfio_lstat64  (const   char   *[4m[22mpath[24m[1m,
47struct stat64 *[4m[22mstatbuf[24m[1m);[0m
48       [1mint   rfio_mstat64   (const  char  *[4m[22mpath[24m[1m,
49struct stat64 *[4m[22mstatbuf[24m[1m);[0m
50
51[1mDESCRIPTION[0m
52       [1mrfio_stat [22mgets information about a file or directo‐
53ry.
54
55       [1mrfio_lstat  [22mis identical to [1mrfio_stat [22mexcept
56for symbolic links. In this
57       case, the link itself is statted and not followed.
58
59       [1mrfio_fstat [22mis  identical  to  [1mrfio_stat  [22mbut
60works on the file descriptor [1ms[0m
61       returned by [1mrfio_open[22m.
62
63       [1mrfio_mstat   [22mis   identical to [1mrfio_stat [22mbut
64keeps the connection open to
65       the server unless there  are  more  than  MAXMCON  connec‐
66tions  already
67       opened.   This   is  useful  when issuing a series of stat
68calls.  The last
69       [1mrfio_mstat [22mcall should be followed  by  a  call  to
70[1mrfio_end[22m.
71
72       [1mrfio_mstat_reset [22mis to be used when your program is
73forking. In such  a
74       case   the   permanent   connections   opened  with  [1mr‐
75fio_mstat [22mbecome shared
76       between  the parent and the child. Use [1mrfio_mstat_reset
77[22mto  perform  the
78       necessary  reset  and close of the socket file  descriptor
79in the parent
80       or the child in order to be sure that only  of  them  will
81receice  an
82       answer from the RFIO daemon.
83
84       See NOTES section below.
85
86       [4mpath[24m   specifies the logical pathname  relative  to
87the current directory
88              or the full pathname.
89
90       [4mstatbuf[0m
91              is a pointer to a  [1mstat  [22mstructure,  receiv‐
92ing  result  of  your
93              query.
94
95       The  64 bits functions must be used for large files.  They
96have the same
97       syntax  as  the  normal stat functions  except  that  they
98use  a  [1mstat64[0m
99       structure.
100
101[1mRETURN VALUE[0m
102       This  routine  returns  0  if the operation was successful
103or ‐1 if the
104       operation failed. In the latter case, [1mserrno [22mis set
105appropriately.
106
107[1mNOTES[0m
108       Multiple connections using rfio_mstat are thread‐safe  but
109not  process‐
110       wide,   therefore   a forked child can share file descrip‐
111tors opened with
112       rfio_mstat by its parent. Use  [1mrfio_mstat_reset  [22min
113such case.
114
115       Multiple  connections  behaviour is undefined if you  work
116in  a  multi‐
117       threaded   environment    and    with    threads    [1mnot
118[22mcreated using the LCG’s
119       [1mCthread [22minterface.
120
121[1mERRORS[0m
122       [1mENOENT        [22mThe named file/directory does not ex‐
123ist or is a null path‐
124                    name.
125
126       [1mEBADF        [4m[22ms[24m is not a valid file  descrip‐
127tor.
128
129       [1mEACCES        [22mSearch   permission  is  denied  on a
130component of the [4mpath[0m
131                    prefix.
132
133       [1mEFAULT       [4m[22mpath[24m  or  [4mstatbuf[24m  is  a
134NULL pointer.
135
136       [1mENOTDIR       [22mA  component of [4mpath[24m prefix is
137not a directory.
138
139       [1mENAMETOOLONG  [22mThe  length  of  [4mpath[24m  exceeds
140[1mCA_MAXPATHLEN [22mor the length  of
141                    a  [4mpath[24m  component  exceeds [1mCA_MAX‐
142NAMELEN[22m.
143
144       [1mSENOSHOST    [22mHost unknown.
145
146       [1mSENOSSERV    [22mService unknown.
147
148       [1mSECOMERR     [22mCommunication error.
149
150[1mSEE ALSO[0m
151       [1mCastor_limits(4)[22m,    [1mrfio_chmod(3)[22m,    [1mr‐
152fio_chown(3)[22m, [1mCthread(3)[0m
153
154[1mAUTHOR[0m
155       [1mLCG Grid Deployment [22mTeam
156
157
158
159LCG                         $Date:    2005/03/31    13:13:03    $
160RFIO_STAT(3)
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
Impressum