File: rfio_stat.man

package info (click to toggle)
lfc-postgres 1.7.4.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 13,676 kB
  • ctags: 10,779
  • sloc: ansic: 146,136; sh: 13,176; perl: 11,142; python: 5,529; cpp: 5,113; sql: 1,790; makefile: 861; fortran: 113
file content (168 lines) | stat: -rw-r--r-- 4,291 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
.\"
.\" $Id: rfio_stat.man,v 1.1 2005/03/31 13:13:03 baud Exp $
.\"
.\" @(#)$RCSfile: rfio_stat.man,v $ $Revision: 1.1 $ $Date: 2005/03/31 13:13:03 $ CERN IT-PDP/DM Jean-Philippe Baud
.\" Copyright (C) 1999-2002 by CERN/IT/PDP/DM
.\" All rights reserved
.\"
.TH RFIO_STAT 3 "$Date: 2005/03/31 13:13:03 $" CASTOR "Rfio Library Functions"
.SH NAME
rfio_stat \- get information about a file or directory
.SH SYNOPSIS
.B #include <sys/types.h>
.br
\fB#include "rfio_api.h"\fR
.sp
.BI "int rfio_stat (const char *" path ", struct stat *" statbuf ");"
.br
.BI "int rfio_fstat (int " s ", struct stat *" statbuf ");"
.br
.BI "int rfio_lstat (const char *" path ", struct stat *" statbuf ");"
.br
.BI "int rfio_mstat (const char *" path ", struct stat *" statbuf ");"
.br
.BI "int rfio_mstat_reset ();"
.br
.BI "int rfio_end ();"
.br
.br
.sp
Under Linux, for large files:
.br
.B #define _LARGEFILE64_SOURCE
.br
.B #include <sys/types.h>
.br
\fB#include "rfio_api.h"\fR
.sp
.BI "int rfio_stat64 (const char *" path ", struct stat64 *" statbuf ");"
.br
.BI "int rfio_fstat64 (int " s ", struct stat64 *" statbuf ");"
.br
.BI "int rfio_lstat64 (const char *" path ", struct stat64 *" statbuf ");"
.br
.BI "int rfio_mstat64 (const char *" path ", struct stat64 *" statbuf ");"
.sp
For large files, under other systems:
.br
.B #include <sys/types.h>
.br
\fB#include "rfio_api.h"\fR
.sp
.BI "int rfio_stat64 (const char *" path ", struct stat64 *" statbuf ");"
.br
.BI "int rfio_fstat64 (int " s ", struct stat64 *" statbuf ");"
.br
.BI "int rfio_lstat64 (const char *" path ", struct stat64 *" statbuf ");"
.br
.BI "int rfio_mstat64 (const char *" path ", struct stat64 *" statbuf ");"
.SH DESCRIPTION
.B rfio_stat
gets information about a file or directory.
.LP
.B rfio_lstat
is identical to
.B rfio_stat
except for symbolic links. In this case, the link itself is statted and not
followed.
.LP
.B rfio_fstat
is identical to
.B rfio_stat
but works on the file descriptor
.B s
returned by
.BR rfio_open .
.LP
.B rfio_mstat
is identical to
.B rfio_stat
but keeps the connection open to the server unless there are more than MAXMCON
connections already opened. This is useful when issuing a series of stat calls.
The last
.B rfio_mstat
call should be followed by a call to
.BR rfio_end .
.LP
.B rfio_mstat_reset
is to be used when your program is forking. In such a case the permanent connections opened with
.B rfio_mstat
become shared between the parent and the child. Use
.B rfio_mstat_reset
to perform the necessary reset and close of the socket file descriptor in the parent or the child in order to be sure that only of them will receice an answer from the RFIO daemon. 
.LP
See NOTES section below.
.TP
.I path
specifies the logical pathname relative to the current directory or
the full pathname.
.TP
.I statbuf
is a pointer to a
.B stat
structure, receiving result of your query.
.P
The 64 bits functions must be used for large files. They have the same syntax as the normal stat functions except that they use a 
.B stat64
structure. 
.SH RETURN VALUE
This routine returns 0 if the operation was successful or -1 if the operation
failed. In the latter case,
.B serrno
is set appropriately.
.SH NOTES
Multiple connections using rfio_mstat are thread-safe but not process-wide, therefore a forked child can share file descriptors opened with rfio_mstat by its parent. Use
.B rfio_mstat_reset
in such case.
.P
Multiple connections behaviour is undefined if you work in a multi-threaded environment and with threads \fBnot\fP created using the CASTOR's \fBCthread\fP interface.
.SH ERRORS
.TP 1.3i
.B ENOENT
The named file/directory does not exist or is a null pathname.
.TP
.B EBADF
.I s
is not a valid file descriptor.
.TP
.B EACCES
Search permission is denied on a component of the
.I path
prefix.
.TP
.B EFAULT
.I path
or
.I statbuf
is a NULL pointer.
.TP
.B ENOTDIR
A component of
.I path
prefix is not a directory.
.TP
.B ENAMETOOLONG
The length of
.I path
exceeds
.B CA_MAXPATHLEN
or the length of a
.I path
component exceeds
.BR CA_MAXNAMELEN .
.TP
.B SENOSHOST
Host unknown.
.TP
.B SENOSSERV
Service unknown.
.TP
.B SECOMERR
Communication error.
.SH SEE ALSO
.BR Castor_limits(4) ,
.BR rfio_chmod(3) ,
.BR rfio_chown(3) ,
.BR Cthread(3)
.SH AUTHOR
\fBCASTOR\fP Team <castor.support@cern.ch>