1LFC_READDIRXP(3)             LFC Library Functions            LFC_READDIRXP(3)
2
3
4

NAME

6       lfc_readdirxp  -  read  LFC directory opened by lfc_opendir in the name
7       server
8

SYNOPSIS

10       #include <sys/types.h>
11       #include "lfc_api.h"
12
13       struct lfc_direnrep *lfc_readdirxp (lfc_DIR *dirp, char *pattern,  char
14       *se)
15

DESCRIPTION

17       lfc_readdirxp reads the LFC directory opened by lfc_opendir in the name
18       server.  It does restricted pattern matching on basename.  This routine
19       returns a pointer to a structure containing the current directory entry
20       (basename, guid and filesize) and the replica information.
21
22       struct lfc_rep_info {
23            u_signed64     fileid;
24            char      status;
25            char      *host;
26            char      *sfn;
27       };
28
29       struct lfc_direnrep {
30            u_signed64     fileid;
31            char      guid[CA_MAXGUIDLEN+1];
32            mode_t         filemode;
33            u_signed64     filesize;
34            int       nbreplicas;
35            struct lfc_rep_info *rep;     /* array of replica info structures */
36            unsigned short d_reclen; /* length of this entry */
37            char      d_name[1];     /* basename in variable length */
38       };
39
40       lfc_readdirxp caches a variable number of such  entries,  depending  on
41       the  filename  size,  to  minimize  the  number of requests to the name
42       server.
43
44       dirp   specifies the pointer value returned by lfc_opendir.
45
46       pattern
47              allows to restrict the listing to entries  having  the  basename
48              starting with this pattern.
49
50       se     allows to restrict the replica entries to a given SE.
51

RETURN VALUE

53       This  routine  returns  a pointer to a structure containing the current
54       directory entry if the operation was successful or NULL if the  end  of
55       the  directory  was reached or if the operation failed. When the end of
56       the directory is encountered, serrno is not changed. If  the  operation
57       failed, serrno is set appropriately.
58
59       As  lfc_readdirxp  returns a null pointer both at the end of the direcā€
60       tory and on error, an application wishing to check for error situations
61       should  set serrno to 0, then call lfc_readdirxp, then check serrno and
62       if it is non-zero, assume an error has occurred.
63

ERRORS

65       EBADF        File descriptor in DIR structure is invalid.
66
67       ENOMEM       Memory could not be allocated for unmarshalling the reply.
68
69       EFAULT       dirp is a NULL pointer.
70
71       EINVAL       The length of pattern exceeds CA_MAXNAMELEN or the  length
72                    of se exceeds CA_MAXHOSTNAMELEN.
73
74       SENOSHOST    Host unknown.
75
76       SENOSSERV    Service unknown.
77
78       SECOMERR     Communication error.
79
80       ENSNACT      Name server is not running or is being shutdown.
81

SEE ALSO

83       lfc_closedir(3), lfc_opendirg(3), lfc_rewinddir(3)
84

AUTHOR

86       LCG Grid Deployment Team
87
88
89
90LFC                      $Date: 2007/12/13 11:59:47 $         LFC_READDIRXP(3)
Impressum