1RFIO_STAT(3)                Rfio Library Functions                RFIO_STAT(3)
2
3
4

NAME

6       rfio_stat - get information about a file or directory
7

SYNOPSIS

9       #include <sys/types.h>
10       #include "rfio_api.h"
11
12       int rfio_stat (const char *path, struct stat *statbuf);
13       int rfio_fstat (int s, struct stat *statbuf);
14       int rfio_lstat (const char *path, struct stat *statbuf);
15       int rfio_mstat (const char *path, struct stat *statbuf);
16       int rfio_mstat_reset ();
17       int rfio_end ();
18
19       Under Linux, for large files:
20       #define _LARGEFILE64_SOURCE
21       #include <sys/types.h>
22       #include "rfio_api.h"
23
24       int rfio_stat64 (const char *path, struct stat64 *statbuf);
25       int rfio_fstat64 (int s, struct stat64 *statbuf);
26       int rfio_lstat64 (const char *path, struct stat64 *statbuf);
27       int rfio_mstat64 (const char *path, struct stat64 *statbuf);
28
29       For large files, under other systems:
30       #include <sys/types.h>
31       #include "rfio_api.h"
32
33       int rfio_stat64 (const char *path, struct stat64 *statbuf);
34       int rfio_fstat64 (int s, struct stat64 *statbuf);
35       int rfio_lstat64 (const char *path, struct stat64 *statbuf);
36       int rfio_mstat64 (const char *path, struct stat64 *statbuf);
37

DESCRIPTION

39       rfio_stat gets information about a file or directory.
40
41       rfio_lstat is identical to rfio_stat except for symbolic links. In this
42       case, the link itself is statted and not followed.
43
44       rfio_fstat is identical to rfio_stat but works on the file descriptor s
45       returned by rfio_open.
46
47       rfio_mstat  is  identical to rfio_stat but keeps the connection open to
48       the server unless there  are  more  than  MAXMCON  connections  already
49       opened.  This  is useful when issuing a series of stat calls.  The last
50       rfio_mstat call should be followed by a call to rfio_end.
51
52       rfio_mstat_reset is to be used when your program is forking. In such  a
53       case  the  permanent  connections  opened with rfio_mstat become shared
54       between the parent and the child. Use rfio_mstat_reset to  perform  the
55       necessary  reset  and close of the socket file descriptor in the parent
56       or the child in order to be sure that only  of  them  will  receice  an
57       answer from the RFIO daemon.
58
59       See NOTES section below.
60
61       path   specifies the logical pathname relative to the current directory
62              or the full pathname.
63
64       statbuf
65              is a pointer to a  stat  structure,  receiving  result  of  your
66              query.
67
68       The  64 bits functions must be used for large files. They have the same
69       syntax as the normal stat functions  except  that  they  use  a  stat64
70       structure.
71

RETURN VALUE

73       This  routine  returns  0  if the operation was successful or -1 if the
74       operation failed. In the latter case, serrno is set appropriately.
75

NOTES

77       Multiple connections using rfio_mstat are thread-safe but not  process-
78       wide,  therefore  a forked child can share file descriptors opened with
79       rfio_mstat by its parent. Use rfio_mstat_reset in such case.
80
81       Multiple connections behaviour is undefined if you  work  in  a  multi-
82       threaded  environment  and  with  threads  not  created using the LCG's
83       Cthread interface.
84

ERRORS

86       ENOENT       The named file/directory does not exist or is a null path‐
87                    name.
88
89       EBADF        s is not a valid file descriptor.
90
91       EACCES       Search  permission  is  denied  on a component of the path
92                    prefix.
93
94       EFAULT       path or statbuf is a NULL pointer.
95
96       ENOTDIR      A component of path prefix is not a directory.
97
98       ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length  of
99                    a path component exceeds CA_MAXNAMELEN.
100
101       SENOSHOST    Host unknown.
102
103       SENOSSERV    Service unknown.
104
105       SECOMERR     Communication error.
106

SEE ALSO

108       Castor_limits(4), rfio_chmod(3), rfio_chown(3), Cthread(3)
109

AUTHOR

111       LCG Grid Deployment Team
112
113
114
115LCG                      $Date: 2005/03/31 13:13:03 $             RFIO_STAT(3)
Impressum