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

NAME

6       lfc_readdirg  -  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_direnstatg *lfc_readdirg (lfc_DIR *dirp)
14

DESCRIPTION

16       lfc_readdirg 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 including the GUID associated.
19
20       struct lfc_direnstatg {
21            u_signed64     fileid;
22            char      guid[CA_MAXGUIDLEN+1];
23            mode_t         filemode;
24            int       nlink;         /* number of files in a directory */
25            uid_t          uid;
26            gid_t          gid;
27            u_signed64     filesize;
28            time_t         atime;         /* last access to file */
29            time_t         mtime;         /* last file modification */
30            time_t         ctime;         /* last metadata modification */
31            short          fileclass;     /* not used */
32            char      status;        /* ' ' --> online, 'm' --> migrated */
33            char      csumtype[3];   /* "CS", "AD" or "MD" */
34            char      csumvalue[33];
35            unsigned short d_reclen; /* length of this entry */
36            char      d_name[1];     /* basename in variable length */
37       };
38
39       lfc_readdirg caches a variable number of such entries, depending on the
40       filename size, to minimize the number of requests to the name server.
41
42       dirp   specifies the pointer value returned by lfc_opendir.
43

RETURN VALUE

45       This  routine  returns  a pointer to a structure containing the current
46       directory entry if the operation was successful or NULL if the  end  of
47       the  directory  was reached or if the operation failed. When the end of
48       the directory is encountered, serrno is not changed. If  the  operation
49       failed, serrno is set appropriately.
50
51       As lfc_readdirg returns a null pointer both at the end of the directory
52       and on error, an application wishing  to  check  for  error  situations
53       should  set  serrno to 0, then call lfc_readdirg, then check serrno and
54       if it is non-zero, assume an error has occurred.
55

ERRORS

57       EBADF        File descriptor in DIR structure is invalid.
58
59       EFAULT       dirp is a NULL pointer.
60
61       SENOSHOST    Host unknown.
62
63       SENOSSERV    Service unknown.
64
65       SECOMERR     Communication error.
66
67       ENSNACT      Name server is not running or is being shutdown.
68

SEE ALSO

70       lfc_closedir(3), lfc_opendirg(3), lfc_rewinddir(3)
71

AUTHOR

73       LCG Grid Deployment Team
74
75
76
77LFC                      $Date: 2006/03/16 13:02:57 $          LFC_READDIRG(3)
Impressum