1LFC_READDIRG(3)                   LFC      Library      Functions
2LFC_READDIRG(3)
3
4
5
6[1mNAME[0m
7       lfc_readdirg   ‐    read    LFC    directory   opened   by
8[1mlfc_opendir [22min the name
9       server
10
11[1mSYNOPSIS[0m
12       [1m#include <sys/types.h>[0m
13       [1m#include "lfc_api.h"[0m
14
15       [1mstruct     lfc_direnstatg     *lfc_readdirg    (lfc_DIR
16*[4m[22mdirp[24m[1m)[0m
17
18[1mDESCRIPTION[0m
19       [1mlfc_readdirg [22mreads  the  LFC  directory  opened  by
20[1mlfc_opendir [22min the  name
21       server.    This   routine returns a pointer to a structure
22containing the
23       current directory entry including the GUID associated.
24
25       struct lfc_direnstatg {
26            u_signed64     fileid;
27            char      guid[CA_MAXGUIDLEN+1];
28            mode_t         filemode;
29            int       nlink;         /* number of files in a  di‐
30rectory */
31            uid_t          uid;
32            gid_t          gid;
33            u_signed64     filesize;
34            time_t          atime;         /* last access to file
35*/
36            time_t         mtime;         /* last file  modifica‐
37tion */
38            time_t          ctime;         /* last metadata modi‐
39fication */
40            short          fileclass;     /* not used */
41            char      status;        /* ’ ’ ‐‐> online,  ’m’  ‐‐>
42migrated */
43            char      csumtype[3];   /* "CS", "AD" or "MD" */
44            char      csumvalue[33];
45            unsigned short d_reclen; /* length of this entry */
46            char       d_name[1];      /*  basename  in  variable
47length */
48       };
49
50       [1mlfc_readdirg [22mcaches a variable number of  such  en‐
51tries, depending on the
52       filename  size,  to minimize the number of requests to the
53name server.
54
55       [4mdirp[24m   specifies  the  pointer  value  returned  by
56[1mlfc_opendir[22m.
57
58[1mRETURN VALUE[0m
59       This   routine  returns  a pointer to a structure contain‐
60ing the current
61       directory entry if the operation was successful or NULL if
62the  end  of
63       the   directory   was  reached or if the operation failed.
64When the end of
65       the directory is encountered, serrno is  not  changed.  If
66the  operation
67       failed, [1mserrno [22mis set appropriately.
68
69       As  lfc_readdirg returns a null pointer both at the end of
70the directory
71       and on error, an application wishing  to  check  for   er‐
72ror  situations
73       should   set   [1mserrno [22mto 0, then call lfc_readdirg,
74then check [1mserrno [22mand
75       if it is non‐zero, assume an error has occurred.
76
77[1mERRORS[0m
78       [1mEBADF        [22mFile descriptor in  DIR  structure  is
79invalid.
80
81       [1mEFAULT       [4m[22mdirp[24m is a NULL pointer.
82
83       [1mSECOMERR     [22mCommunication error.
84
85       [1mENSNACT      [22mName server is not running or is being
86shutdown.
87
88[1mSEE ALSO[0m
89       [1mlfc_closedir(3)[22m,            [1mlfc_opendirg(3)[22m,
90[1mlfc_rewinddir(3)[0m
91
92[1mAUTHOR[0m
93       [1mLCG Grid Deployment [22mTeam
94
95
96
97LFC                                                        $Date$
98LFC_READDIRG(3)
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
Impressum