1LFC_READDIRXR(3) LFC Library Functions LFC_READDIRXR(3)
2
3
4
6 lfc_readdirxr - read LFC directory opened by lfc_opendir in the name
7 server
8
10 #include <sys/types.h>
11 #include "lfc_api.h"
12
13 struct lfc_direnrep *lfc_readdirxr (lfc_DIR *dirp, char *se)
14
16 lfc_readdirxr reads the LFC directory opened by lfc_opendir in the name
17 server. This routine returns a pointer to a structure containing the
18 current directory entry (basename, guid and filesize) and the replica
19 information.
20
21 struct lfc_rep_info {
22 u_signed64 fileid;
23 char status;
24 char *host;
25 char *sfn;
26 };
27
28 struct lfc_direnrep {
29 u_signed64 fileid;
30 char guid[CA_MAXGUIDLEN+1];
31 mode_t filemode;
32 u_signed64 filesize;
33 int nbreplicas;
34 struct lfc_rep_info *rep; /* array of replica info structures */
35 unsigned short d_reclen; /* length of this entry */
36 char d_name[1]; /* basename in variable length */
37 };
38
39 lfc_readdirxr caches a variable number of such entries, depending on
40 the filename size, to minimize the number of requests to the name
41 server.
42
43 dirp specifies the pointer value returned by lfc_opendir.
44
45 se allows to restrict the replica entries to a given SE.
46
48 This routine returns a pointer to a structure containing the current
49 directory entry if the operation was successful or NULL if the end of
50 the directory was reached or if the operation failed. When the end of
51 the directory is encountered, serrno is not changed. If the operation
52 failed, serrno is set appropriately.
53
54 As lfc_readdirxr returns a null pointer both at the end of the direcā
55 tory and on error, an application wishing to check for error situations
56 should set serrno to 0, then call lfc_readdirxr, then check serrno and
57 if it is non-zero, assume an error has occurred.
58
60 EBADF File descriptor in DIR structure is invalid.
61
62 ENOMEM Memory could not be allocated for unmarshalling the reply.
63
64 EFAULT dirp is a NULL pointer.
65
66 EINVAL The length of se exceeds CA_MAXHOSTNAMELEN.
67
68 SENOSHOST Host unknown.
69
70 SENOSSERV Service unknown.
71
72 SECOMERR Communication error.
73
74 ENSNACT Name server is not running or is being shutdown.
75
77 lfc_closedir(3), lfc_opendirg(3), lfc_rewinddir(3)
78
80 LCG Grid Deployment Team
81
82
83
84LFC $Date: 2006/03/16 13:02:57 $ LFC_READDIRXR(3)